This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Signal handling rewrite for Linux / i386


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]