[kaffe] java.lang.UnsatisfiedLinkError: not enough memory
Ito Kazumitsu
kaz at maczuka.gcd.org
Fri May 16 15:49:02 PDT 2003
The problem is
AWT cannot be used with kaffe on FreeBSD (mine is 4.7-RELEASE).
As I see it from the backtrace list of gdb (attached below), there may be
something wrong in libltdl/ltdl.c.
To make things simple, I made a simple program (taken from
http://www.asahi-net.or.jp/~dp8t-asm/java/tips/AppFrameHelloWorld.html).
import java.awt.*;
class AWTTest extends Frame {
public static void main(String args[]) {
try {
AWTTest app = new AWTTest();
app.show();
}
catch (Exception e) {
e.printStackTrace();
}
}
AWTTest() {
setSize(100, 70);
}
public void paint(Graphics g) {
g.drawString("Hello World!!", 20, 50);
}
}
Then I made kaffe with the following options:
CPPFLAGS="-I/usr/local/include" CFLAGS="-g" LIBS="-L/usr/local/lib -ldlmalloc" ./configure --with-libiconv-prefix=/usr/local --enable-debug
Here I used Doug Lea's malloc-2.7.2 instead of FreeBSD's malloc
because the former is more convenient for debugging (Doug Lea's
dumps core when error occurs while FreeBSD's only shows a warning
message).
Then I run
bash-2.05b$ java -vmdebug ALL AWTTest > vmdebug.log 2>&1
Bus error (core dumped)
bash-2.05b$ gdb /usr/local/kaffe/jre/bin/kaffe-bin kaffe-bin.core
GNU gdb 4.18 (FreeBSD)
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...Deprecated bfd_read called at /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb/gdb/dbxread.c line 2627 in elfstab_build_psymtabs
Deprecated bfd_read called at /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb/gdb/dbxread.c line 933 in fill_symbuf
Core was generated by `kaffe-bin'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/local/kaffe/jre/lib/i386/libkaffevm-1.1.x-cvs.so...
done.
Reading symbols from /usr/lib/libm.so.2...done.
Reading symbols from /usr/local/lib/libiconv.so.3...done.
Reading symbols from /usr/lib/libc.so.4...done.
Reading symbols from /usr/local/kaffe/jre/lib/i386/libnative-1.1.x-cvs.so...
done.
Reading symbols from /usr/local/kaffe/jre/lib/i386/libio-1.1.x-cvs.so...done.
Reading symbols from /usr/libexec/ld-elf.so.1...done.
#0 0x2827988d in memcpy () from /usr/lib/libc.so.4
(gdb) bt
#0 0x2827988d in memcpy () from /usr/lib/libc.so.4
#1 0x28 in ?? ()
#2 0x280bd6c0 in rpl_argz_append (pargz=0xbfbfd15c, pargz_len=0xbfbfd158,
buf=0x817e7e9 "/usr/X11R6/lib", buf_len=15) at ltdl.c:581
#3 0x280bd99f in rpl_argz_insert (pargz=0xbfbfd15c, pargz_len=0xbfbfd158,
before=0x0, entry=0x817e7e9 "/usr/X11R6/lib") at ltdl.c:680
#4 0x280c0f65 in lt_argz_insert (pargz=0xbfbfd15c, pargz_len=0xbfbfd158,
before=0x0, entry=0x817e7e9 "/usr/X11R6/lib") at ltdl.c:3524
#5 0x280c20e3 in lt_dlpath_insertdir (ppath=0x281049a4, before=0x0,
dir=0x817e7e9 "/usr/X11R6/lib") at ltdl.c:3981
#6 0x280c21e5 in lt_dladdsearchdir (search_dir=0x817e7e9 "/usr/X11R6/lib")
at ltdl.c:4006
#7 0x280bf84d in load_deplibs (handle=0x814fcd8,
deplibs=0x817e7c0 " -L/usr/local/lib -ljpeg -lpng -lz -lm -L/usr/X11R6/lib") at ltdl.c:2837
#8 0x280c077d in try_dlopen (phandle=0xbfbfd2b4,
filename=0x8192350 "/usr/local/kaffe/jre/lib/i386/libawt.la")
at ltdl.c:3302
#9 0x280c0d37 in lt_dlopenext (
filename=0xbfbfd3e8 "/usr/local/kaffe/jre/lib/i386/libawt") at ltdl.c:3466
#10 0x28093715 in loadNativeLibrary2 (
path=0xbfbfd3e8 "/usr/local/kaffe/jre/lib/i386/libawt", default_refs=1,
errbuf=0xbfbfd368 "\a", errsiz=128) at external.c:251
#11 0x280935a6 in loadNativeLibrary (
lib=0xbfbfd3e8 "/usr/local/kaffe/jre/lib/i386/libawt",
errbuf=0xbfbfd368 "\a", errsiz=128) at external.c:191
#12 0x2836d346 in java_lang_NativeLibrary_linkLibrary (jpath=0x8195800)
at NativeLibrary.c:67
#13 0x812c1e7 in ?? ()
#14 0x8122a70 in ?? ()
#15 0x811b326 in ?? ()
#16 0x81054af in ?? ()
#17 0x8183119 in ?? ()
#18 0x280b9494 in sysdepCallMethod (call=0xbfbfdb54)
at ../../config/i386/common.h:38
#19 0x280b87f1 in callMethodA (meth=0x8190c70, func=0x8189178, obj=0x0,
args=0x0, ret=0xbfbfd94c, promoted=0) at support.c:606
#20 0x280a60c3 in Kaffe_CallStaticVoidMethodA (env=0x281043f0, cls=0x817b5e0,
meth=0x8190c70, args=0x0) at jni.c:2397
#21 0x2807c5d9 in processClass (class=0x817b5e0, tostate=11, einfo=0xbfbfdd1c)
at classMethod.c:481
#22 0x280b2865 in soft_fixup_trampoline (_data=0x81933d5) at soft.c:575
#23 0x280efe7e in i386_do_fixup_trampoline () at machine.c:1187
#24 0x8179c85 in ?? ()
#25 0x8184847 in ?? ()
#26 0x280b9494 in sysdepCallMethod (call=0xbfbfe010)
at ../../config/i386/common.h:38
#27 0x280b87f1 in callMethodA (meth=0x8175740, func=0x81729d0, obj=0x0,
args=0x0, ret=0xbfbfde08, promoted=0) at support.c:606
#28 0x280a60c3 in Kaffe_CallStaticVoidMethodA (env=0x281043f0, cls=0x8157ea0,
meth=0x8175740, args=0x0) at jni.c:2397
#29 0x2807c5d9 in processClass (class=0x8157ea0, tostate=11, einfo=0xbfbfe1d0)
at classMethod.c:481
#30 0x280b1b26 in soft_new (c=0x8157ea0) at soft.c:49
#31 0x8197441 in ?? ()
#32 0x280b9494 in sysdepCallMethod (call=0xbfbfe498)
at ../../config/i386/common.h:38
#33 0x280b87f1 in callMethodA (meth=0x8156d48, func=0x81724a8, obj=0x0,
args=0x0, ret=0xbfbfe290, promoted=0) at support.c:606
#34 0x280a60c3 in Kaffe_CallStaticVoidMethodA (env=0x281043f0, cls=0x8157e00,
meth=0x8156d48, args=0x0) at jni.c:2397
#35 0x2807c5d9 in processClass (class=0x8157e00, tostate=11, einfo=0xbfbfe65c)
at classMethod.c:481
#36 0x280b27ba in soft_initialise_class (c=0x8157e00) at soft.c:547
#37 0x816bc30 in ?? ()
#38 0x8157d1e in ?? ()
#39 0x280b9494 in sysdepCallMethod (call=0xbfbfe934)
at ../../config/i386/common.h:38
#40 0x280b87f1 in callMethodA (meth=0x8142a60, func=0x8159ec8, obj=0x0,
args=0x0, ret=0xbfbfe72c, promoted=0) at support.c:606
#41 0x280a60c3 in Kaffe_CallStaticVoidMethodA (env=0x281043f0, cls=0x8138cc0,
meth=0x8142a60, args=0x0) at jni.c:2397
#42 0x2807c5d9 in processClass (class=0x8138cc0, tostate=11, einfo=0xbfbfebb8)
at classMethod.c:481
#43 0x2807c399 in processClass (class=0x8138680, tostate=11, einfo=0xbfbfebb8)
at classMethod.c:415
#44 0x2807c399 in processClass (class=0x8138220, tostate=11, einfo=0xbfbfebb8)
at classMethod.c:415
#45 0x2836c20d in java_lang_ClassLoader_resolveClass0 (this=0x811ad48,
class=0x8138220) at ClassLoader.c:130
#46 0x81450b5 in ?? ()
#47 0x812b2a8 in ?? ()
#48 0x81392a2 in ?? ()
#49 0x813a769 in ?? ()
#50 0x811c9b9 in ?? ()
#51 0x280b94b0 in sysdepCallMethod (call=0xbfbfef30)
at ../../config/i386/common.h:45
#52 0x280b8d9d in callMethodV (meth=0x8091060, func=0x811c980, obj=0x0,
args=0xbfbff0b0 "/", ret=0xbfbff024) at support.c:826
#53 0x280b7ed7 in do_execute_java_class_method_v (
cname=0x280fd40e "java.lang.Class", loader=0x0,
method_name=0x280fd406 "forName",
signature=0x280fd3e0 "(Ljava/lang/String;)Ljava/lang/Class;",
argptr=0xbfbff0ac "�\022\b/") at support.c:237
#54 0x280b7f27 in do_execute_java_class_method (
cname=0x280fd40e "java.lang.Class", loader=0x0,
method_name=0x280fd406 "forName",
signature=0x280fd3e0 "(Ljava/lang/String;)Ljava/lang/Class;")
at support.c:261
#55 0x2809e774 in Kaffe_FindClass (env=0x281043f0, name=0xbfbff71c "AWTTest")
at jni.c:347
#56 0x8048be8 in main2 (env=0x281043f0, argv=0xbfbff5e8, farg=4, argc=0)
at main.c:206
#57 0x8048b79 in main (argc=1, argv=0xbfbff5e8) at main.c:145
#58 0x8048979 in _start ()
(gdb)
I put vmdebug.log at
http://www.jsdi.or.jp/~maczuka/kaffe/vmdebug.log.gz
Please check.
More information about the kaffe
mailing list