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]
Other format: [Raw text]

Help me with gcj 3.4.1 on Mandrake Linux 10.1


Problem:   even very simple Java program causes "Segmentation Fault"

Environment:HP/Compaq nx5000 (Laptop),
                       Mandrake 10.1 Official,  
                       gcc/gcj 3.4.1 ( installed from Mandrake 10.1 CD) ,  
                       binutils 2.15.90

:
1.  Java Source file:x.java
==================================================
class Y
{
       public static void main( String args[] )
       {
               X ob = new X();

               System.out.println(" I got here " + ob);
       }
}
class X
{
       int i = 10;


       public String toString()
       {
               return String.valueOf( i );
       }
       // nothing

}
=============================================
This code was compiling and running normally under either Mandrake 10.0 Official
or Debian.

2.  Compile:

$  gcj -o x --main=Y x.java

I got a excutable file : x

3.  Run it:

$  ./x

Segmentation fault  ---- Here the problem is!!!

4.  I tried to :

$  ldd x
       linux-gate.so.1 =>  (0xffffe000)
       libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40031000)
       libgcj.so.5 => /usr/lib/libgcj.so.5 (0x4003a000)
       libm.so.6 => /lib/tls/libm.so.6 (0x409b9000)
       libpthread.so.0 => /lib/tls/libpthread.so.0 (0x409dd000)
       libz.so.1 => /lib/libz.so.1 (0x409ee000)
       libdl.so.2 => /lib/libdl.so.2 (0x409ff000)
       libc.so.6 => /lib/tls/libc.so.6 (0x40a02000)
       /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

It seems like ok for libraries.

$ gdb x

GNU gdb 6.2-2mdk (Mandrakelinux)
Copyright 2004 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 "i586-mandrake-linux-gnu"...Using host libthread_db
library "/lib/tls/libthread_db.so.1".

(gdb) run
Starting program: /home/b34/Java/Javacode/x
[Thread debugging using libthread_db enabled]
[New Thread 1085412640 (LWP 7875)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1085412640 (LWP 7875)]
0x404689d2 in _Jv_FindClass () from /usr/lib/libgcj.so.5
(gdb) bt
#0  0x404689d2 in _Jv_FindClass () from /usr/lib/libgcj.so.5
#1  0x40468241 in java::lang::Class::forName () from /usr/lib/libgcj.so.5
#2  0x4046839e in java::lang::Class::forName () from /usr/lib/libgcj.so.5
#3  0x40427656 in gnu::gcj::convert::UnicodeToBytes::getDefaultEncoder () from
/usr/lib/libgcj.so.5
#4  0x404a4042 in java::io::PrintStream::PrintStream () from /usr/lib/libgcj.so.5
#5  0x4048815d in java::lang::System::__U3c_clinit__U3e_ () from /usr/lib/libgcj.so.5
#6  0x40467e2a in java::lang::Class::initializeClass () from /usr/lib/libgcj.so.5
#7  0x4060c6b7 in _Jv_InitClass () from /usr/lib/libgcj.so.5
#8  0x40488572 in java::lang::System::getProperty () from /usr/lib/libgcj.so.5
#9  0x4048b68d in java::lang::VMClassLoader::getSystemClassLoader () from
/usr/lib/libgcj.so.5
#10 0x40479eaa in java::lang::ClassLoader::__U3c_clinit__U3e_ () from
/usr/lib/libgcj.so.5
#11 0x40467e2a in java::lang::Class::initializeClass () from /usr/lib/libgcj.so.5
#12 0x4044462f in _Jv_CreateJavaVM () from /usr/lib/libgcj.so.5
#13 0x404446af in _Jv_RunMain () from /usr/lib/libgcj.so.5
#14 0x40444847 in JvRunMain () from /usr/lib/libgcj.so.5
#15 0x08048b75 in main ()
(gdb)


Could any one help me to fix this problem?

Thanks

Liuto


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