This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
java.io.Serializable - trivial program segfaults
- From: "hugl herst" <huglhuglhugl at gmx dot net>
- To: java at gcc dot gnu dot org
- Date: Mon, 14 Mar 2005 18:00:14 +0100 (MET)
- Subject: java.io.Serializable - trivial program segfaults
Hello,
I'm trying to compile a working networked application with gcj. The
Application works fine using sun's jre.
The problem seems to be serialization of an object, running the program
causes a segmentation fault (SIGSEV).
I'm not sure what I'm doing wrong here, it's a very simple test.
To reproduce the error this is all I need:
/**Test.java:**/
package gcjtest;
public class Test {
public Test() {
Serialobject o = new Serialobject();
}
public static void main(String[] args) {
Test t = new Test();
}
}
/**********************/
/**Serialobject.java:**/
package gcjtest;
import java.io.Serializable;
public class Serialobject implements Serializable {
private static final long serialVersionUID = 3546362842354823992L;
public Serialobject() {
super();
}
}
/**********************/
Compiling:
gcj -g --main=gcjtest.Test gcjtest/Serialobject.java gcjtest/Test.java -o
test
gdb backtrace:
(gdb) r
Starting program: /workspace/gcjtest/test
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 6333)]
[New Thread 32769 (LWP 6334)]
[New Thread 16386 (LWP 6335)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 6333)]
0x405555af in _Jv_linkExceptionClassTable () from /usr/lib/libgcj.so.5
(gdb) bt
#0 0x405555af in _Jv_linkExceptionClassTable () from /usr/lib/libgcj.so.5
#1 0x4055736a in java::lang::Class::initializeClass () from
/usr/lib/libgcj.so.5
#2 0x40533782 in _Jv_AllocObjectNoFinalizer () from /usr/lib/libgcj.so.5
#3 0x08048972 in gcjtest.Test.Test() (this=0x8071f80) at Test.java:22
#4 0x080489b9 in gcjtest.Test.main(java.lang.String[]) (args=0x8073fc8) at
Test.java:27
#5 0x4054e24c in gnu::gcj::runtime::FirstThread::call_main () from
/usr/lib/libgcj.so.5
#6 0x405d4d09 in gnu::gcj::runtime::FirstThread::run () from
/usr/lib/libgcj.so.5
#7 0x4055eff6 in _Jv_ThreadRun () from /usr/lib/libgcj.so.5
#8 0x4053484f in _Jv_RunMain () from /usr/lib/libgcj.so.5
#9 0x40534958 in JvRunMain () from /usr/lib/libgcj.so.5
#10 0x08048948 in main (argc=1, argv=0xbffffd94) at /tmp/cciuH3ON.i:11
(gdb)
gcj --version: gcj (GCC) 3.3.5 (Debian 1:3.3.5-8)
uname -a: Linux foobox 2.4.25-1-386 #2 Wed Apr 14 19:38:08 EST 2004 i686
GNU/Linux
Maybe someone can give me a hint what I'm doing wrong here.
Best Regards,
Lothar
--
DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen!
AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl