This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Question about POSIX libgcj signals / exception handling
- From: Andrew Haley <aph at redhat dot com>
- To: Mohan Embar <gnustuff at thisiscool dot com>
- Cc: java at gcc dot gnu dot org
- Date: Sat, 11 Mar 2006 17:26:07 +0000
- Subject: Re: Question about POSIX libgcj signals / exception handling
- References: <URC8D9GFKFBA0KF94DBGOWT3YDCIC.441257fc@d9300>
Mohan Embar writes:
> Are the signal handlers in POSIX libgcj set up such that the
> application is bulletproof and immune from core dumps? Even if I do
> native stuff where I divide by zero or dereference invalid
> pointers? I'm not overly experienced with POSIX signal handling
> and was wondering if a try...catch block in my main() method was
> sufficient enough to catch all mishaps, even native ones. Also, are
> there any restrictions or caveats concerning what I can do when
> reacting to exceptions triggered by such signals (as opposed to
> "normal" Java exceptions)?
Just one thing to add to David's comments: this isn't POSIX, and only
works because you have detailed knowledge of the operating system.
Exactly what you can do in a signal handler depends on the OS, not
some abstract standard like POSIX.
> I seem to recall from the little UNIX
> programming I've done that you shouldn't do too much in a signal
> handler.
Right, but this isn't UNIX, it's Linux. Usually that difference
doesn't matter, but in this case it does. MD_FALLBACK_FRAME_STATE_FOR
has to be OS-specific.
Andrew.