This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: Signal handling rewrite for Linux / i386
- From: Andrew Haley <aph at redhat dot com>
- To: "Boehm, Hans" <hans_boehm at hp dot com>
- Cc: java at gcc dot gnu dot org
- Date: Mon, 18 Oct 2004 18:57:15 +0100
- Subject: RE: Signal handling rewrite for Linux / i386
- References: <40700B4C02ABD5119F000090278766443BEF2A@hplex1.hpl.hp.com><15441.10410.731209.816260@cuddles.cambridge.redhat.com>
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.