This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/11809] New: trivial hello world compiles, but segfaults
- From: "owen at email dot arc dot nasa dot gov" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Aug 2003 17:57:41 -0000
- Subject: [Bug java/11809] New: trivial hello world compiles, but segfaults
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11809
Summary: trivial hello world compiles, but segfaults
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: java
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: owen at email dot arc dot nasa dot gov
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: gcc 3.3
GCC host triplet: redhat 7.3
I assume that I have something miscompiled, but it works fine under the gcc-3.2
that I installed previously.
% cat hello.java
public class hello {
public static void main(String[] args) {
System.out.println("Hello world");
}
}
% ~/tools/gcc-3.3/bin/gcj --main=hello -g hello.java
% ./a.out
Segmentation fault (core dumped)
% gdb a.out core.7119
GNU gdb 5.3
Copyright 2002 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 "i686-pc-linux-gnu"...
Core was generated by `./a.out'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /home/owen/tools/gcc-3.3/lib/libgcc_s.so.1...done.
Loaded symbols for /home/owen/tools/gcc-3.3/lib/libgcc_s.so.1
Reading symbols from /home/owen/tools/gcc-3.3/lib/libgcj.so.4...done.
Loaded symbols for /home/owen/tools/gcc-3.3/lib/libgcj.so.4
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
#0 0x00000060 in ?? ()
(gdb) where
#0 0x00000060 in ?? ()
#1 0x40393882 in _Jv_Throw (value=0x808bfa0) at exception.cc:100
#2 0x403a4b65 in java::lang::Class::forName(java::lang::String*, bool,
java::lang::ClassLoader*) (className=0x80978c0, initialize=1 '\001',
loader=0x80acfc0)
at java/lang/natClass.cc:83
#3 0x403a4c2a in java::lang::Class::forName(java::lang::String*) (
className=0x4a415641) at java/lang/natClass.cc:110
#4 0x4036ec0a in gnu.gcj.convert.UnicodeToBytes.getDefaultEncoder() ()
at gnu/gcj/convert/UnicodeToBytes.java:49
#5 0x403e5fac in java.io.PrintStream.PrintStream(java.io.OutputStream, boolean)
(this=0x2, out=0x4a415641) at java/io/PrintStream.java:241
#6 0x403cc3be in java.lang.System.<clinit>() () at java/lang/System.java:135
#7 0x403a6279 in java::lang::Class::initializeClass() (this=0x8049d10)
at java/lang/natClass.cc:814
#8 0x405505bc in _Jv_InitClass (klass=0x4a415641) at java/lang/Class.h:265
#9 0x403cbc98 in java.lang.System.getProperty(java.lang.String) (key=0x1)
at java/lang/System.java:393
#10 0x403cf022 in java.lang.Throwable.<clinit>() ()
at java/lang/Throwable.java:403
#11 0x403a6279 in java::lang::Class::initializeClass() (this=0x8049d10)
at java/lang/natClass.cc:814
#12 0x403a62b5 in java::lang::Class::initializeClass() (this=0x8049d10)
at java/lang/Class.h:265
#13 0x403a62b5 in java::lang::Class::initializeClass() (this=0x8049d10)
at java/lang/Class.h:265
#14 0x403a62b5 in java::lang::Class::initializeClass() (this=0x8049d10)
at java/lang/Class.h:265
#15 0x40386341 in _Jv_AllocObjectNoFinalizer (klass=0x8049d10, size=20)
at java/lang/Class.h:265
#16 0x4038637c in _Jv_AllocObject (klass=0x1, size=1245795905) at prims.cc:415
#17 0x40387213 in _Jv_CreateJavaVM(void*) () at prims.cc:921
#18 0x403873ff in _Jv_RunMain(java::lang::Class*, char const*, int, char
const**, bool) (klass=0x8049ae0, name=0x0, argc=1, argv=0xbfffd6d4, is_jar=false)
at prims.cc:973
#19 0x403875bd in JvRunMain (klass=0x4a415641, argc=1245795905,
argv=0x4a415641) at prims.cc:1011
#20 0x080488f4 in main (argc=1, argv=0xbfffd6d4) at /tmp/cc6SIN37.i:11
#21 0x408671c4 in __libc_start_main () from /lib/libc.so.6