Bug 2319

Summary: JUnit sig-segvs when attempting to print a stack backtrace
Product: frysk Reporter: Andrew Cagney <cagney>
Component: generalAssignee: Andrew Cagney <cagney>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P1    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Project(s) to access: ssh public key:
Bug Depends on:    
Bug Blocks: 1580    

Description Andrew Cagney 2006-02-10 04:58:49 UTC
at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)

Running testBBB(frysk.event.TestEventLoop) ...Segmentation fault (core dumped)
Comment 1 Andrew Cagney 2006-02-10 05:02:38 UTC
The problem here is that the java runtime, and frysk are fighting over the
SIGCHLD handler.  Even though frysk doesn't create any child processes, GCJ
does.  GCJ can create two processes:

- a process to demangle symbols
- [possibly] a process to perform address -> line conversion

and install a null sigchld handler.  Frysk, in turn, installs its own
long-jumping handler.

A crash occures when frysk's handler finds itself processing a signal that was
ment for the core.  It attempts to longjmp through a bad buffer.
Comment 2 Andrew Cagney 2006-02-10 05:04:10 UTC
This helps, the jumpbuf has a flag indicating that it should be used.  It will
stop the bad long-jump.

2006-02-09  Andrew Cagney  <cagney@redhat.com>

       * cni/Poll.cxx (struct poll_jmpbuf): Replace poll_env.  A
       per-thread buffer.
Comment 3 Andrew Cagney 2006-02-10 16:55:30 UTC
Index: frysk-core/common/ChangeLog
2006-02-10  Andrew Cagney  <cagney@redhat.com>

        * Makefile.gen.sh (echo_LDFLAGS): Append $(GEN_GCJ_NO_SIGCHLD_FLAGS).
        (echo_name_): New function.
        (echo_LDFLAGS): Use.
        (echo_MANS): Check if man page is needed.
        (echo_PROGRAMS): Move call to echo_MANS out of echo_PROGRAMS.
        (GEN_UBASENAME): Rename GEN_BASEUNAME).
        * Makefile.rules (GEN_GCJ_NO_SIGCHLD_FLAGS): Define.

Index: frysk-core/frysk/event/ChangeLog
2006-02-10  Andrew Cagney  <cagney@redhat.com>

        * TestSigChild.java: New.

unfortunatly this makes stack backtraces sux