patch for JNI wrapper (was: Bug in GC?)

Alexandre Oliva oliva at
Sun Aug 9 03:04:52 PDT 1998

Alexandre Oliva <oliva at> writes:

> 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 problem was related with JNI wrapper functions, used only by the
JIT engine.  On sparc, the start of the code of JNI wrapper was not
at the beginning of a memory block, because the JIT compiler generated 
a few constants.  However, the method structure only pointed to the
beginning of the code, so that the code would never be marked, and it
would end up being reclaimed by the garbage collector.

The attached patch fixes this problem, ensuring that the same
mechanism used to install JIT-generated code is used to install the
JNI wrapper.

Alexandre Oliva
mailto:oliva at mailto:aoliva at
Universidade Estadual de Campinas, SP, Brasil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jniwrapper.diff
Type: application/octet-stream
Size: 1830 bytes
Desc: not available
Url : 

More information about the kaffe mailing list