[kaffe] Kaffe plugin

Dalibor Topic robilad@kaffe.org
Thu Oct 9 07:59:02 2003


Hi Aleksandr,

Абакин Александр wrote:
> Hi!
> 
> I have constructed plugin for Mozilla 1.3.

Wow! Did you write the plugin from scratch, or did you get the 
kaffe-mozilla-oji plugin to work?

> But at start the exception takes off:
> 
> Program /usr/src/mozilla/mozilla/dist/bin/mozilla-bin (pid = 9917) received Segmentation fault signal.
> Stack:
> FatalSignalHandler__13nsProfileLocki+0x00000139 [/usr/src/mozilla/mozilla/dist/bin/components/libprofile.so +0x0002D0D9]
> UNKNOWN [/lib/libpthread.so.0 +0x00008FEB]
> UNKNOWN [/lib/libc.so.6 +0x0002A6F8]
> stringCharArray2Java+0x000001B5 [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0003FEF5]

Judging by this bit, the error occurs somewhere in the 
stringCharArray2Java conversion function. Could try running it under a 
debugger, like gdb, and report the backtrace? The hexadecimal offsets 
are not as helpful as file+line given by gdb ;) Make sure you read 
FAQ/FAQ.debugging to learn more about debugging kaffe, and build it with 
--enable-debug and --enable-xdebugging.

> utf8Const2JavaReplace+0x000000B5 [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0003F755]
> utf8Const2Java+0x0000001F [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0003F68F]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x000142D2]
> processClass+0x00000314 [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x00011784]
> loadClass+0x00000105 [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x000138E5]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x00026B01]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x00026A86]
> getClassFromSignature+0x0000002C [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x00026B5C]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x00059F33]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0005A648]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0005905A]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x00056C2F]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0004A33C]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0004749E]
> verify3+0x0000018C [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0004704C]
> processClass+0x00000435 [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x000118A5]
> loadClass+0x00000105 [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x000138E5]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x00026B01]
> getClassFromSignature+0x0000002C [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x00026B5C]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x00059F33]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0005A049]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0004B0AB]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0004A887]
> UNKNOWN [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0004749E]
> verify3+0x0000018C [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0004704C]
> processClass+0x00000435 [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x000118A5]
> loadStaticClass+0x0000011C [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x00013A8C]
> initBaseClasses+0x000000B2 [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x00011162]
> initialiseKaffe+0x0000023A [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x0001103A]
> JNI_CreateJavaVM+0x000000AA [/usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.2.so +0x00028E6A]
> StartVM__9ojiPlugin+0x00000228 [/usr/src/mozilla/mozilla/dist/bin/components/libojiplugin.so +0x00007BA8]

> The error arises in loadtime of static classes.

That's probably the most fragile bit at the moment. Some things need to 
be initialized before others, and some fields of some classes must be 
statically initailized, causing other classes to be loaded in turn. 
Always great fun to debug ;) Take a look at System.java, and uncomment 
the debugging functions there to see what's excatly happening.

> Starts to be loaded ClassClass, occurs call to StringClass (???),
> which in this moment = NULL
 >
> When has rearranged by places loadStaticClass(&ClassClass, CLASSCLASS)
> and loadStaticClass(&StringClass, STRINGCLASS) all classes has loaded,
> but began to arise other error - in getCurrentThread() tid = 0!

I think you may be seeing an instance of this bug: 
http://www.kaffe.org/pipermail/kaffe/2001-September/038987.html
and a possible workaruond: 
http://www.kaffe.org/pipermail/kaffe/2001-September/038990.html

cheers,
dalibor topic