8086278: java/lang/ProcessHandle/TreeTest.java failed - ProcessReaper StackOverflowException
Summary: Increase reaper stack size by 50% to 48k
Reviewed-by: chegar, martin
--- a/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java Wed Apr 13 11:03:16 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java Wed Apr 13 16:57:49 2016 -0400
@@ -52,6 +52,11 @@
*/
final class ProcessHandleImpl implements ProcessHandle {
/**
+ * Default size of stack for reaper processes.
+ */
+ private static long REAPER_DEFAULT_STACKSIZE = 128 * 1024;
+
+ /**
* Cache the ProcessHandle of this process.
*/
private static final ProcessHandleImpl current;
@@ -79,10 +84,12 @@
ThreadGroup tg = Thread.currentThread().getThreadGroup();
while (tg.getParent() != null) tg = tg.getParent();
ThreadGroup systemThreadGroup = tg;
+ final long stackSize = Boolean.getBoolean("jdk.lang.processReaperUseDefaultStackSize")
+ ? 0 : REAPER_DEFAULT_STACKSIZE;
ThreadFactory threadFactory = grimReaper -> {
- long stackSize = Boolean.getBoolean("jdk.lang.processReaperUseDefaultStackSize") ? 0 : 32768;
- Thread t = new Thread(systemThreadGroup, grimReaper, "process reaper", stackSize);
+ Thread t = new Thread(systemThreadGroup, grimReaper,
+ "process reaper", stackSize, false);
t.setDaemon(true);
// A small attempt (probably futile) to avoid priority inversion
t.setPriority(Thread.MAX_PRIORITY);