Signal handling rewrite for Linux / i386

Andrew Haley aph@redhat.com
Mon Oct 18 17:58:00 GMT 2004


An old thread from http://gcc.gnu.org/ml/java/2002-01/msg00169.html.
Andrew Haley writes:
 > 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.
That's an interesting idea.
 > Does my patch not allocate the altstack in just the right place?
Hans, you never did reply to this AFAICS. 
To remind you: I set up the stack like this --
 high memory +-------------------------+ 
 | | 
 | | 
 | stack | 
 | | 
 +-------------------------+ <- sp
 | | | 
 | | | 
 | V | 
 | | 
 | | 
 | | 
 | | 
 | | 
 | | 
 | | 
 +-------------------------+ 
 | | 
 | guard area | 
 | (mapped READ_ONLY) | 
 | | 
 +-------------------------+ 
 | | <- initial signal stack 
 | |
 | |
 | |
 | alt stack |
 | |
 | |
 | |
 | |
 low memory +-------------------------+
So, the gc should run quite happily on the altstack. Is this okay?
Andrew.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /