comparison src/share/vm/runtime/thread.hpp @ 8710:9058789475af

7107135: Stack guard pages are no more protected after loading a shared library with executable stack Summary: Detect the execstack attribute of the loaded library and attempt to fix the stack guard using Safepoint op. Reviewed-by: dholmes, zgu Contributed-by: ioi.lam@oracle.com
author iklam
date Tue, 05 Mar 2013 13:55:56 -0800
parents db9981fd3124
children b9a918201d47 35f8765422b9
comparison
equal deleted inserted replaced
8709:255c0a4cb4eb 8710:9058789475af
1 /* 1 /*
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
1287 void enable_stack_yellow_zone(); 1287 void enable_stack_yellow_zone();
1288 void disable_stack_yellow_zone(); 1288 void disable_stack_yellow_zone();
1289 void enable_stack_red_zone(); 1289 void enable_stack_red_zone();
1290 void disable_stack_red_zone(); 1290 void disable_stack_red_zone();
1291 1291
1292 inline bool stack_guard_zone_unused();
1292 inline bool stack_yellow_zone_disabled(); 1293 inline bool stack_yellow_zone_disabled();
1293 inline bool stack_yellow_zone_enabled(); 1294 inline bool stack_yellow_zone_enabled();
1294 1295
1295 // Attempt to reguard the stack after a stack overflow may have occurred. 1296 // Attempt to reguard the stack after a stack overflow may have occurred.
1296 // Returns true if (a) guard pages are not needed on this thread, (b) the 1297 // Returns true if (a) guard pages are not needed on this thread, (b) the
1757 inline CompilerThread* JavaThread::as_CompilerThread() { 1758 inline CompilerThread* JavaThread::as_CompilerThread() {
1758 assert(is_Compiler_thread(), "just checking"); 1759 assert(is_Compiler_thread(), "just checking");
1759 return (CompilerThread*)this; 1760 return (CompilerThread*)this;
1760 } 1761 }
1761 1762
1763 inline bool JavaThread::stack_guard_zone_unused() {
1764 return _stack_guard_state == stack_guard_unused;
1765 }
1766
1762 inline bool JavaThread::stack_yellow_zone_disabled() { 1767 inline bool JavaThread::stack_yellow_zone_disabled() {
1763 return _stack_guard_state == stack_guard_yellow_disabled; 1768 return _stack_guard_state == stack_guard_yellow_disabled;
1764 } 1769 }
1765 1770
1766 inline bool JavaThread::stack_yellow_zone_enabled() { 1771 inline bool JavaThread::stack_yellow_zone_enabled() {