7107135: Stack guard pages are no more protected after loading a shared library with executable stack

Detect the execstack attribute of the loaded library and attempt to fix the stack guard using Safepoint op.

Reviewed-by: dholmes, zgu
This commit is contained in:
Ioi Lam 2013-03-05 13:55:56 -08:00 committed by Ioi Lam
parent 112317dbe3
commit 5116181e1f
13 changed files with 464 additions and 3 deletions

View file

@ -410,6 +410,11 @@ inline static bool checkOverflow(sigcontext* uc,
// to handle_unexpected_exception way down below.
thread->disable_stack_red_zone();
tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
// This is a likely cause, but hard to verify. Let's just print
// it as a hint.
tty->print_raw_cr("Please check if any of your loaded .so files has "
"enabled executable stack (see man page execstack(8))");
} else {
// Accessing stack address below sp may cause SEGV if current
// thread has MAP_GROWSDOWN stack. This should only happen when