Help using gij

Matt Welsh mdw@cs.berkeley.edu
Sun Nov 7 18:59:00 GMT 1999


Hi folks,

I am having problems running gij. This appears to be manifesting itself
in the form of a problem with exception handling.

I have compiled the latest egcs snapshot (02-Nov-1999) and the latest 
libgcj. I did compile libgcj with --enable-interpreter (some documentation 
would have been nice). gij simply crashes when I try to use it. There 
seems to be several problems:

  1) ResourceBundle ends up looking for the class
      gnu.gcj.text.LocaleData_en_US_UNIX 
     which doesn't exist -- I copied LocaleData_en_US.java to 
     LocaleData_en_US_UNIX.java and built that into libgcj.

  2) ResourceBundle is looking for the properties file
      ./gnu/gcj/text/LocaleData_en_US_UNIX.properties
     which doesn't exist. This causes FileDescriptor::open to throw
     an exception which crashes gij. 
     
I guess to sum up, it's broke. There's no documentation on gij anywhere
that I can find; am I simply doing something wrong?

It appears that the crash is due to an exception being thrown when the
properties file doesn't exist. If I create empty properties files, another
exception is being generated from DecimalFormat.applyPattern -- probably
because the format of the files is meaningless. Again - some documentation
would be nice.

Now, I did modify ResourceBundle.trySomeGetBundle to put the try { ... } 
clause around the call to ClassLoader.getSystemResourceAsStream(), in case 
that method is throwing an exception rather than returning null. Looking at 
the code, however, java.net.URLClassLoader.getResourceAsStream should be 
catching the FileNotFoundException from way down in 
java.io.FileDescriptor.open. 

This doesn't appear to be happening, however - it seems that the exception
being generated by the lack of a properties file is just crashing the 
program, rather than having it be nicely caught at the right place and
converted into a 'null' return value for getSystemResourceAsStream(). 

The gdb stack trace up to ResourceBundle.trySomeGetBundle is shown below.
This is on an x86 Linux system (Red Hat 6.0) with the "Javaified" gdb 4.18.

Does anyone have any idea what's going on?

Thanks much,
Matt Welsh, UC Berkeley

--
(gdb) where
#0  0x4022d111 in __kill () from /lib/libc.so.6
#1  0x401d6f7b in raise (sig=6) at signals.c:63
#2  0x4022e447 in abort () at ../sysdeps/generic/abort.c:88
#3  0x4012a185 in get_reg_addr (reg=256, udata=0xbf7fd04c, sub_udata=0x0)
   from /usr/local/ninja/egcs-jaguar/lib/libgcj.so.1
#4  0x4012a23b in next_stack_level (pc=0x400949bb, udata=0xbf7fd04c, 
    caller_udata=0xbf7fcfd4) from /usr/local/ninja/egcs-jaguar/lib/libgcj.so.1
#5  0x4012a44a in throw_helper (eh=0x808db88, pc=0x400949bb, 
    my_udata=0xbf7fd10c, offset_p=0xbf7fd108)
   from /usr/local/ninja/egcs-jaguar/lib/libgcj.so.1
#6  0x4012a6d8 in __throw () from /usr/local/ninja/egcs-jaguar/lib/libgcj.so.1
#7  0x400949bc in Letext ()
    at /home/cs/mdw/disks/enclave1/libgcj-991104/libjava/exception.cc:154
#8  0x401104c1 in java::io::FileDescriptor::open (this=0x8064ee0, 
    path=0x8063030, jflags=1)
    at /home/cs/mdw/disks/enclave1/libgcj-991104/libjava/gcj/cni.h:117
#9  0x400b680c in java.io.FileDescriptor.FileDescriptor (this=0x8064ee0, 
    path=0x8063030, mode=1)
    at /home/cs/mdw/disks/enclave1/libgcj-991104/libjava/java/io/FileDescriptor.java:47
#10 0x400b69d7 in java.io.FileInputStream.FileInputStream (this=0x8064ef0, 
    name=0x8063030)
    at /home/cs/mdw/disks/enclave1/libgcj-991104/libjava/java/io/FileInputStream.java:31
#11 0x400b6a34 in java.io.FileInputStream.FileInputStream (this=0x8064ef0, 
    file=0x8064f00)
    at /home/cs/mdw/disks/enclave1/libgcj-991104/libjava/java/io/FileInputStream.java:36
#12 0x400ac664 in gnu.gcj.protocol.file.Connection.getInputStream (
    this=0x8061600)
    at /home/cs/mdw/disks/enclave1/libgcj-991104/libjava/gnu/gcj/protocol/file/Connection.java:61
#13 0x400df17a in java.net.URL.openStream (this=0x8060360)
    at /home/cs/mdw/disks/enclave1/libgcj-991104/libjava/java/net/URL.java:263
#14 0x400e035e in java.net.URLClassLoader.getResourceAsStream (this=0x8063eb8, 
    name=0x80630a8)
    at /home/cs/mdw/disks/enclave1/libgcj-991104/libjava/java/net/URLClassLoader.java:167
#15 0x400c70b6 in java.lang.ClassLoader.getSystemResourceAsStream (
    name=0x80630a8)
    at /home/cs/mdw/disks/enclave1/libgcj-991104/libjava/java/lang/ClassLoader.java:357
#16 0x401025ce in java.util.ResourceBundle.trySomeGetBundle (
    bundleName=0x8063120, stopHere=0x80630f0)
    at /home/cs/mdw/disks/enclave1/libgcj-991104/libjava/java/util/ResourceBundle.java:203





More information about the Java mailing list