This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

gcj vs. SIGSEGV


Hello,

I have problems to get even simple java programs to work with gcj.
I use gcc-3.3.2 (more details below); the problem was exactly the same with gcc-3.3.1.
The test program is ripped out from the gettext distribution and looks like

public class conftest {
  public static void main (String[] args) {
    try {
      java.util.ResourceBundle.getBundle("foobar");
    } catch (Exception e) {
    }
    System.exit(0);
  }
}

Compiling this programm with gcj -g und running under gdb-6 i get

GNU gdb 6.0
Copyright 2003 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-pc-linux-gnu"...
(gdb) run
Starting program: /home/fehrin/conftest
[New Thread 1024 (LWP 1150)]
[New Thread 2049 (LWP 1152)]
[New Thread 1026 (LWP 1153)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 1150)]
0x080a2f98 in java::lang::String::endsWith(java::lang::String*) ()
(gdb) bt
#0  0x080a2f98 in java::lang::String::endsWith(java::lang::String*) ()
#1  0x080bfbe2 in gnu::gcj::runtime::VMClassLoader::<clinit>() ()
#2  0x0808ee83 in java::lang::Class::initializeClass() ()
#3  0x080908c6 in _Jv_InitClass ()
#4  0x081a9e40 in vtable for gnu::gcj::runtime::VMClassLoader ()
#5  0x081a9e40 in vtable for gnu::gcj::runtime::VMClassLoader ()
#6  0x08286f44 in __JCR_END__ ()
#7  0x0809b8bf in java::lang::ClassLoader::getSystemClassLoader() ()

Not all java programs get SIGSEGV; the simplest "hello world" does work.

My configuration is

more /etc/SuSE-release
SuSE Linux 7.3 (i386)
VERSION = 7.3

uname -a
Linux franz 2.4.22-ac1 #3 Sat Sep 6 21:06:29 CEST 2003 i586 unknown unknown GNU/LinuxLinux

gcj -v
Reading specs from /usr/local/gcc3/bin/../lib/gcc-lib/i586-pc-linux-gnu/3.3.2/specs
Reading specs from /usr/local/gcc3/bin/../lib/gcc-lib/i586-pc-linux-gnu/3.3.2/../../../libgcj.spec
rename spec lib to liborig
Konfiguriert mit: ../gcc-3.3.2/configure --prefix=/usr/local/gcc-3.3.2 --with-as=/usr/local/gcc-3.3.2/bin/as -with-ld=/usr/local/gcc-3.3.2/bin/ld -enable-__cxa_atexit --enable-threads --disable-shared --enable-languages=c++,java --with-pic --enable-concept-checks --with-x --enable-initfini-array --enable-java-awt=gtk,xlib --with-system-zlib
Thread model: posix
gcc-Version 3.3.2

The relevant environment variables are
export CPPFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/include/ncurses"
export PIC="-fPIC -DPIC"
export FLAGS="$CPPFLAGS -pipe -O3 -fomit-frame-pointer -ffast-math -march=k6 -m3dnow -mmmx"
export CFLAGS="$FLAGS"
export STAGE1_CFLAGS=$CFLAGS
export BOOT_CFLAGS=$CFLAGS
export LIBCFLAGS="$CFLAGS $PIC"
export CXXFLAGS=$FLAGS
export LIBCXXFLAGS="$CXXFLAGS $PIC"
export GCJFLAGS="-pipe -Wp,-D_REENTRANT -Wp,-D_GNU_SOURCE -Wp,-D_FILE_OFFSET_BITS=64 -O3 -fomit-frame-pointer -ffast-math -marchexport LDFLAGS="-O3 -L/usr/local/lib -L/usr/X11R6/lib"
export BOOT_LDFLAGS=$LDFLAGS
export STAGE1_LDFLAGS=$LDFLAGS
export LD_RUN_PATH=/usr/local/lib

Is this a known problem (perhaps with solution)?

Gretings

Franz


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