Signal handling rewrite for Linux / i386

Andrew Haley aph@cambridge.redhat.com
Fri Jan 25 01:43:00 GMT 2002


Boehm, Hans writes:
 > Is there any way we can preallocate the stack overflow exception, so that it
 > doesn't need to be allocated in the signal handler?

We can pre-allocate one for each thread, yes.

 > There are two problems with allocating it in the signal handler:
 > 
 > 1) Either the garbage collector needs to understand sigaltstack, or you need
 > to use clever hacks in allocating the alternate stack in just the right
 > place.  Otherwise you could just set up SIGSEGV so that the thread stopping
 > signals are disabled in the handler, and thus the collector should never see
 > any of this, I think.

Does my patch not allocate the alttack in just the right place?

 > 2) I suspect the alternate stack needs to be larger than you think, since
 > the collector may need to run in it.  If parallel collection is enabled, it
 > puts its local mark stack there, among other things.

Okay.

 > The linuxthreads code for pthread_self() on some platforms gets much slower
 > if you use nondefault stack sizes.

Oh right; that's worth investigating.  I did make sure that
pthread_self() still worked.

 > Does anyone understand on what platforms that still matters?  I
 > believe it doesn't if you can reserve a register for the thread
 > pointer.

Andrew.



More information about the Java mailing list