Bug in GC?

Alexandre Oliva oliva at dcc.unicamp.br
Wed Aug 5 22:32:01 PDT 1998

Hi!  I've been hunting a bug in Kaffe JIT on sparc-sun-solaris2.5,
possibly related with memory management.  The program that reproduces
the problem is a *very* simple one, it's attached.

It runs perfectly well on i686-pc-linux-gnu, with both engines, and on
sparc-sun-solaris2.5, with the interpreter engine.  However, if I run
it with the JIT engine, it consistently stops (unreported SIGBUS)
after a certain small and repeatable number of iterations.  The
interaction count may vary, depending on debugging options you have
enabled, but it is absolutely constant given a certain build of

Looks like the problem occurs as the garbage collector runs, because,
if I run with -verbosemem, it will stop just after printing the first
GC message:

1322<GC: heap 5120K, total 4204K, alloc 6705K, marked 625K, freeing 3578K>

The problem already existed in Kaffe 1.0.b1, but not in 0.10.1.
Curiously, this problem also causes Sun JDK 1.1.6/Solaris/sparc to
deadlock with itself on *some* executions. :-)

I've run it with -verbosegc within gdb, and I got the following stack trace:

1322<GC: heap 5120K, total 4204K, alloc 6705K, marked 625K, freeing 3578K>

Program received signal SIGBUS, Bus error.
0x388e60 in ?? ()
(gdb) wherejit
Cannot access memory at address 0x1c.
(gdb) up
#1  0x388e18 in ?? ()
(gdb) wherejit
java/io/PrintWriter.write([CII)V: 388db8 388e48
(gdb) up 
#2  0x4670f0 in ?? ()
(gdb) wherejit
java/io/PrintWriter.write(Ljava/lang/String;)V: 466fd0 4670f8
(gdb) up
#3  0x3f3218 in ?? ()
(gdb) wherejit
java/io/PrintWriter.print(Ljava/lang/String;)V: 3f31e8 3f3220
(gdb) up
#4  0x367d4c in ?? ()
(gdb) wherejit
java/io/PrintStream.print(Ljava/lang/String;)V: 367d18 367d54
(gdb) up
#5  0x466554 in ?? ()
(gdb) wherejit
test.main([Ljava/lang/String;)V: 466430 466568

I'll keep trying to find this bug, but if there's any other bug hunter 
seeking for bugs, please feel free to go after this one ;-)


Alexandre Oliva
mailto:oliva at dcc.unicamp.br mailto:aoliva at acm.org
Universidade Estadual de Campinas, SP, Brasil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.java
Type: application/octet-stream
Size: 138 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/19980806/c4be3e54/attachment-0006.obj 

More information about the kaffe mailing list