AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with signal chaining with IBM JRE 1.4.1 under LInux

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> ibm.software.java.linux
View previous topic :: View next topic  
Author Message
Richard Cook
Guest





PostPosted: Fri Mar 05, 2004 10:21 pm    Post subject: Problem with signal chaining with IBM JRE 1.4.1 under LInux Reply with quote



OK, I know this one is wierd, but here goes.

We're writing a kind of "application server" that can take in
requests, and run rules for the requests coded in Java or C. Since the
C code can be developed by customers or third parties we want to catch
the "bad" signals (SIGSEGV, SIGFPE, maybe others) and restart the
application.

When running C code we install our own signal handler, which if called
sets a flag in C code that says "an error has occured". In Java we
have a watchdog thread that looks at the variable via a JNI call, and
if the flag gets set then runs shutdown code and restarts the
application via a call to _execv.

All this works on Linux with Sun's JVM 1.4.1 by using signal chaining.
When the C code runs normally:
We install our own signal handler, run the C code, then put the old
signal handlers back.
When the C code has a problem:
We install our own signal handler, run the C code that causes a
signal, run the signal handler that sets the flag, don't put back the
old signal handlers.

Running with IBM's JVM 1.4.1 it looks like my signal handler does run,
but after IBM's signal handler, and the application still stops.
Here's the end of the run:
JVMDG217: Dump Handler is Processing a Signal - Please Wait.
JVMDG303: JVM Requesting Java core file
JVMDG304: Java core file written to
/home/rrc/javacore.20040305.132039.3827.txt
JVMDG215: Dump Handler has Processed Exception Signal 11.
XXXC In signal handler.
XXXC Leaving signal handler.
Memory fault
[rrc@atl1lx02 rrc]$

I'm using the signal chaining mentioned at Sun's site, by using the
LD_PRELOAD environment variable.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> ibm.software.java.linux All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.