This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Hello world segfaults with -static


Hi!

I do not have any idea, why this segfaults:

public class hello
{
 public static void main(String[] args)
    {
     System.out.println("Hello World");
    }
}

$ gcj -static -g -o hello hello.java --main=hello
$ ./hello
Segmentation fault
 
gdb's output: (although it strangly jumps around in the source)

next_index = 11163 when there is only one entry (GC_excl_table_entries=1)????

Program received signal SIGSEGV, Segmentation fault.
0x80f3edc in GC_exclude_static_roots (start=0x81c18c0, finish=0x81c1a00) at
../../../gcc-3.1/boehm-gc/mark_rts.c:412
412         GC_excl_table[next_index].e_start = (ptr_t)start;
(gdb) where
#0  0x80f3edc in GC_exclude_static_roots (start=0x81c18c0, finish=0x81c1a00) at ../../../gcc-3.1/boehm-gc/mark_rts.c:412
#1  0x80f46a1 in GC_init_inner () at ../../../gcc-3.1/boehm-gc/misc.c:516
#2  0x80f452b in GC_init () at ../../../gcc-3.1/boehm-gc/misc.c:442
#3  0x80ee6bf in GC_init_gcj_malloc (mp_index=0, mp=0x80916f0) at ../../../gcc-3.1/boehm-gc/gcj_mlc.c:59
#4  0x809238a in _Z10_Jv_InitGCv () at ../../../gcc-3.1/libjava/boehm.cc:491
#5  0x805f321 in _Jv_RegisterClasses (classes=0x81cab18) at ../../../gcc-3.1/libjava/java/lang/natClassLoader.cc:435
#6  0x80481e9 in frame_dummy ()
#7  0x80480d1 in _init ()
#8  0x8106a99 in __libc_start_main (main=0x80481f4 <main>, argc=1,
    ubp_av=0xbffff3b4, init=0x80480b4 <_init>, fini=0x81510e0 <_fini>,
    rtld_fini=0, stack_end=0xbffff3ac) at ../sysdeps/generic/libc-start.c:122

This is current cvs.
Reading specs from /sw/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc-3.1/configure --prefix=/sw/gcc-3.1
--enable-languages=c++,f77,java --enable-threads=posix
Thread model: posix
gcc version 3.1 20011010 (experimental)

Thanks for any hint,
Martin.

PS: It works like a charm when you omit -static.

-- 
The early bird catches the worm. If you want something else for       
breakfast, get up later.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]