8130425: libjvm crash due to stack overflow in executables with 32k tbss/tdata
authorcsahu
Fri, 26 Feb 2016 16:19:04 +0530
changeset 36421 84c6303771b8
parent 36420 1709f0cad63f
child 36422 19c7bd1d11cd
8130425: libjvm crash due to stack overflow in executables with 32k tbss/tdata Reviewed-by: kevinw, dholmes Contributed-by: cheleswer.sahu@oracle.com
jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java
--- a/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java	Wed Feb 24 16:33:19 2016 -0500
+++ b/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java	Fri Feb 26 16:19:04 2016 +0530
@@ -81,9 +81,8 @@
                 ThreadGroup systemThreadGroup = tg;
 
                 ThreadFactory threadFactory = grimReaper -> {
-                    // Our thread stack requirement is quite modest.
-                    Thread t = new Thread(systemThreadGroup, grimReaper,
-                            "process reaper", 32768);
+                    long stackSize = Boolean.getBoolean("jdk.lang.processReaperUseDefaultStackSize") ? 0 : 32768;
+                    Thread t = new Thread(systemThreadGroup, grimReaper, "process reaper", stackSize);
                     t.setDaemon(true);
                     // A small attempt (probably futile) to avoid priority inversion
                     t.setPriority(Thread.MAX_PRIORITY);