Need help to understand TLS behavior

Martin Buchholz martinrb at google.com
Wed Dec 16 19:30:52 UTC 2015


On Tue, Dec 15, 2015 at 9:40 PM, David Holmes <david.holmes at oracle.com> wrote:

> As a point fix a way to change the stack size of the process reaper thread
> might suffice. But that is a band-aid. I can imagine bugs of the form "when
> we run our Java code stand-alone it runs fine, but as soon as we embed the
> JVM in our own application front-end it fails with StackOverflowErrors
> everywhere". :(

I'm the one responsible for the small stack size of the process reaper thread.
The result is that any mechanism that snacks on the stack, be it TLS
or guard pages, will first cause the Process code to fail.

If we bump up the reaper thread stack size, then what is a "safe"
value?  And any increase has its own risks, like potentially more
memory and/or address space consumed, possibly leading to OOME.  You
have a choice between StackOverflowError and OutOfMemoryError.  Or you
could properly implement growable/movable/splittable stacks.



More information about the core-libs-dev mailing list