RFR 15: 8217475: Unexpected StackOverflowError in "process reaper" thread
Roger Riggs
Roger.Riggs at oracle.com
Thu Jul 9 14:09:38 UTC 2020
Hi,
I raised the debugDelta to 16k and so far (12hrs) have not seen any
failures.
I'll push later today with 16k unless I hear any concerns.
Webrev:
http://cr.openjdk.java.net/~rriggs/webrev-process-stackoverflow-8217475-1/
Thanks, Roger
On 7/9/20 4:54 AM, David Holmes wrote:
> Hi Roger,
>
> Looks good to me.
>
> Thanks,
> David
>
> On 9/07/2020 6:51 am, Roger Riggs wrote:
>> Please review a change to increase the size of the Process Reaper
>> stack for debug builds.
>> This intermittent issue can be traced to the stack shadow page size
>> being larger
>> in debug builds than in release builds. The problem has only been
>> spotted in debug builds.
>>
>> diff a/src/java.base/share/classes/java/lang/ProcessHandleImpl.java
>> b/src/java.base/share/classes/java/lang/ProcessHandleImpl.java
>> --- a/src/java.base/share/classes/java/lang/ProcessHandleImpl.java
>> +++ b/src/java.base/share/classes/java/lang/ProcessHandleImpl.java
>> @@ -85,12 +85,16 @@
>> doPrivileged((PrivilegedAction<Executor>) () -> {
>>
>> ThreadGroup tg =
>> Thread.currentThread().getThreadGroup();
>> while (tg.getParent() != null) tg = tg.getParent();
>> ThreadGroup systemThreadGroup = tg;
>> +
>> + // For a debug build, the stack shadow zone is larger;
>> + // Increase the total stack size to avoid potential
>> stack overflow.
>> + int debugDelta =
>> "release".equals(System.getProperty("jdk.debug")) ? 0 : 8192;
>> final long stackSize =
>> Boolean.getBoolean("jdk.lang.processReaperUseDefaultStackSize")
>> - ? 0 : REAPER_DEFAULT_STACKSIZE;
>> + ? 0 : REAPER_DEFAULT_STACKSIZE + debugDelta;
>>
>> ThreadFactory threadFactory = grimReaper -> {
>> Thread t = new Thread(systemThreadGroup,
>> grimReaper,
>> "process reaper", stackSize, false);
>> t.setDaemon(true);
>>
>> Webrev:
>> http://cr.openjdk.java.net/~rriggs/webrev-process-stackoverflow-8217475/
>>
>> Issue:
>> https://bugs.openjdk.java.net/browse/JDK-8217475
>>
>> Thanks, Roger
>>
More information about the core-libs-dev
mailing list