BZ #91: CACAO crashes when building GNU Classpath's tools with it

Status fields:

creation_ts:2008-07-25 17:06
version:default branch
twisti@c8:/nfstmp/twisti/classpath/classpath/build-x86_64-linux/tools$ make
mkdir -p -- classes asm
mkdir -p -- generated/gnu/classpath/tools/gjdoc/expr
cacao -classpath /usr/share/java/antlr.jar antlr.Tool -o
generated/gnu/classpath/tools/gjdoc/expr \
ANTLR Parser Generator   Version 2.7.6 (20070206)   1989-2005
LOG: [0x00002aaaab3fd6d0] We received a SIGSEGV and tried to handle it, but we were
LOG: [0x00002aaaab3fd6d0] unable to find a Java method at:
LOG: [0x00002aaaab3fd6d0]
LOG: [0x00002aaaab3fd6d0] PC=0x00002aaaab4ac3ac
LOG: [0x00002aaaab3fd6d0]
LOG: [0x00002aaaab3fd6d0] Dumping the current stacktrace:
        at antlr.preprocessor.Tool.preprocess()Z(
        at antlr.Tool.doEverything([Ljava/lang/String;)I(
        at antlr.Tool.main([Ljava/lang/String;)V(
LOG: [0x00002aaaab3fd6d0] Exiting...
make: *** [] Aborted (core dumped)

(gdb) bt
#0  0x00002aaaab1f007b in raise () from /lib/
#1  0x00002aaaab1f184e in abort () from /lib/
#2  0x00002aaaab475649 in system_abort () at ../../src/vmcore/system.h:94
#3  0x00002aaaab475934 in vm_abort (text=0x2aaaab4f7b78 "Exiting...") at vm.cpp:2040
#4  0x00002aaaab47f12d in methodtree_find (pc=0x2aaaab4ac3ac) at methodtree.c:203
#5  0x00002aaaab4a222b in md_codegen_get_pv_from_pc (ra=0x2aaaab4ac3ac) at
#6  0x00002aaaab4a28f1 in stacktrace_stackframeinfo_add (sfi=0x7fffffffda40, pv=0x0,
sp=0x7fffffffdd70, ra=0x2aaaab4ac3ac, xpc=0x2aaaab4ac3ac) at stacktrace.cpp:124
#7  0x00002aaaab4a402f in trap_handle (type=0, val=0, pv=0x0, sp=0x7fffffffdd70,
ra=0x2aaaab4ac3ac, xpc=0x2aaaab4ac3ac, context=0x7fffffffdb30) at trap.c:145
#8  0x00002aaaab4d2edd in md_signal_handler_sigsegv (sig=11, siginfo=0x7fffffffdc60,
_p=0x7fffffffdb30) at md-os.c:184
#9  <signal handler called>
#10 0x00002aaaab4ac3ac in handle_basic_block (state=0x7fffffffde70) at typecheck.c:547
#11 0x00002aaaab4afb2f in typecheck (jd=0x2aaaacdc2a30) at typecheck.c:790
#12 0x00002aaaab47e3df in jit_compile_intern (jd=0x2aaaacdc2a30) at jit.c:694
#13 0x00002aaaab47dec5 in jit_compile (m=0x2aaaace78cd8) at jit.c:415
#14 0x00002aaaab47e8b9 in jit_compile_handle (m=0x2aaaace78cd8, pv=0x2aaaacfb6d80,
ra=0x2aaaacfb6e7f, mptr=0x2aaaace70130) at jit.c:1074
#15 0x00002aaaab4a4105 in trap_handle (type=9, val=46912533627184, pv=0x0,
sp=0x7fffffffe5d0, ra=0x2aaaacfb6e7f, xpc=0x2aaaacfb6e7c, context=0x7fffffffe180) at
#16 0x00002aaaab4d2edd in md_signal_handler_sigsegv (sig=11, siginfo=0x7fffffffe2b0,
_p=0x7fffffffe180) at md-os.c:184
#17 <signal handler called>
#18 0x00002aaaacfb7d00 in ?? ()
#19 0x00002aaaacfb6e7f in ?? ()
#20 0x0000000000574800 in ?? ()
#21 0x0000000000000000 in ?? ()

Comment #1 by on 2008-07-25 17:08:03

(gdb) fr 10
#10 0x00002aaaab4ac3ac in handle_basic_block (state=0x7fffffffde70) at typecheck.c:547
547                     if ((ex->start->nr <= state->bptr->nr) && (ex->end->nr >
state->bptr->nr)) {

(gdb) p *ex
$2 = {start = 0x2aaaace93ec8, end = 0x2a92d4702028, handler = 0x2aaaace93b08, catchtype
= {ref = 0x0, cls = 0x0, any = 0x0}, next = 0x0, down = 0x2aaaace94088}

(gdb) p *ex->end
Cannot access memory at address 0x2a92d4702028

Comment #2 by on 2008-08-13 15:15:39

*** Bug 87 has been marked as a duplicate of this bug. ***

Comment #3 by on 2008-09-17 14:30:52

It works with ANTLR 2.7.7 on my machine at work:

cthalinger@cthalinger:~/projects/classpath/classpath/build/tools$ make
/bin/mkdir -p classes asm
/bin/mkdir -p generated/gnu/classpath/tools/gjdoc/expr
runantlr -o generated/gnu/classpath/tools/gjdoc/expr \
Running java antlr.Tool $* with /usr/share/java/antlr.jar appended to the CLASSPATH
ANTLR Parser Generator   Version 2.7.7 (20080530)   1989-2005
find ../../tools/external/asm -name '*.java' -print > asm.lst

Comment #4 by on 2009-06-10 11:07:49

Maybe this is the same problem as in #129. twisti, do you remember which compiler you
used to build CACAO? Or if you built with optimization at all?

Comment #5 by on 2009-06-10 11:38:47

Sorry, I have no idea.