Seg fault in libgcj!_Jv_RegisterClassHookDefault()
T Ziomek
t_ziomek@yahoo.com
Mon Aug 16 08:05:00 GMT 2004
[Cygwin on Win2K using gcc34-20040607.tar.bz2 from
<http://www.thisiscool.com/gcc_mingw.htm>. The code uses SWT if that matters;
I'm also using the third party libraries 'jodd' and 'jtopas' (both on Source-
Forge)]
I'm having trouble getting a working build with gcj. The build seems to go o-
kay but when I try running it I get a generic Windows dialog error, "<blah>.exe
has generated errors and will be closed by Windows. You will need to restart
the program. An error log is being created."
Using gdb I get a little more info:
% gdb HaloBrowser
GNU gdb 2003年09月20日-cvs (cygwin-special)
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 "i686-pc-cygwin"...
(gdb) r
Starting program: /tmp/HaloBrowser/HaloBrowser.exe
Program received signal SIGSEGV, Segmentation fault.
0x102caae7 in libgcj!_Jv_RegisterClassHookDefault ()
from /tmp/thisiscool-gcc/gcc-3.4/i686-pc-mingw32/lib/libgcj.dll
(gdb)
I have the 'thisiscool' stuff in my /tmp, but I've rearranged my PATH so all
of the thisiscool apps and DLLs come first:
% echo $PATH
/tmp/bin:/tmp/thisiscool-gcc/gcc-3.4/i686-pc-mingw32/bin:/tmp/thisiscool-gcc/gcc-3.4/i686-pc-mingw32/lib:/cygdrive/d/tjz/bin:/bin:/usr/bin:/usr/local/bin:/cygdrive/c/bin:/usr/sbin:/cygdrive/c/j2sdk1.4.2_04/bin:/cygdrive/c/j2sdk1.4.2_04/jre/bin:/cygdrive/g/odapi:/cygdrive/o/eclipse/plugins/org.eclipse.swt.win32_2.1.2/os/win32/x86:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:/cygdrive/c/WINNT/System32/Wbem
So I'm pretty sure I'm at least building with all of the correct binaries (my
makefile is appended). I've tried building both with and without '-g0 -fjni'
but see the same results either way. The only output from any of the build
steps is a bunch of 'Info' stuff from the final link, describing how it is re-
solving various symbols with auto-imports.
The code builds and runs fine when built within Eclipse (my dev environment).
And I've been able to get a very simple (1 .java file) 'hello world' SWT
program to build & run. But...I could only get that to work by first compil-
ing the .java into a .o and then linking it to get an .exe. I couldn't find
a way to do it in a single build step.
I've searched the maillist archives a couple of times on this; I found some
stuff that resolved earlier issues I was having but now I'm running out of
things to try. Any suggestions? If not, my next step is probably to start
tearing stuff out of the code, making it smaller until I can get something
that runs. Though I have this nagging idea that the problem might be due
to building stuff out of .jar's...
Thanks for any help.
Tom Z
--------------------------------------------------------------------------------
# Makefile (I know it doesn't have the best structure at the moment; it's been
# getting messed with quite a bit as I try things...)
GCC_PREFIX = /tmp/bin
#JFLAGS = -w -g0 -fjni
JFLAGS =
all : HaloBrowser.o HaloBrowser_sub.o ../jodd.o ../jtopas-core.o ../javax.o
$(GCC_PREFIX)/gcj $(JFLAGS) -Wl,--enable-runtime-pseudo-reloc
--main=HaloBrowser -o HaloBrowser.exe HaloBrowser.o HaloBrowser_sub.o ../jodd.o
../jtopas-core.o ../javax.o -L/tmp/thisiscool-gcc/gcc-3.4/i686-pc-mingw32/lib
-L/tmp/thisiscool-gcc/gcc-3.4/lib/gcc/i686-pc-mingw32/3.4.0
HaloBrowser.o : HaloBrowser.java
$(GCC_PREFIX)/gcj $(JFLAGS) -c
--classpath=./HaloBrowser_sub.jar\;/tmp/thisiscool-gcc/gcc-3.4/share/java/libgcj-3.4.0.jar\;../javax.jar\;../jtopas-core.jar\;../jodd.jar
-o HaloBrowser.o HaloBrowser.java
HaloBrowser_sub.o : HaloBrowser_sub.jar
$(GCC_PREFIX)/gcj $(JFLAGS) -c
--classpath=/tmp/thisiscool-gcc/gcc-3.4/share/java/libgcj-3.4.0.jar\;../javax.jar\;../jtopas-core.jar\;../jodd.jar
-o HaloBrowser_sub.o HaloBrowser_sub.jar
../jodd.o : ../jodd.jar
$(GCC_PREFIX)/gcj $(JFLAGS) -c
--classpath=/tmp/thisiscool-gcc/gcc-3.4/share/java/libgcj-3.4.0.jar -o
../jodd.o ../jodd.jar
../jtopas-core.o : ../jtopas-core.jar
$(GCC_PREFIX)/gcj $(JFLAGS) -c
--classpath=/tmp/thisiscool-gcc/gcc-3.4/share/java/libgcj-3.4.0.jar -o
../jtopas-core.o ../jtopas-core.jar
# Explanation of this 'javax' stuff...I use javax.sound.sampled, and that is
# not included in 'libgcj'. Rather than compile the entire rt.jar, I juse
# extracted the classes I need into my own little javax.jar.
../javax.o : ../javax.jar
$(GCC_PREFIX)/gcj $(JFLAGS) -c
--classpath=/tmp/thisiscool-gcc/gcc-3.4/share/java/libgcj-3.4.0.jar -o
../javax.o ../javax.jar
clean :
rm -f HaloBrowser.exe Halo*.o ../*.o
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
More information about the Java
mailing list