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]

Print stack trace hangs in GCJ 3.3 branch


This is the first time I've compiled GCC/GCJ so if I've done something stupid be kind to me :-)

Compiling GCC/GCJ went fine. Compiling and running a 'Hello World' Java program is fine. The problem is I made a simple test case that prints a stack trace and it pauses for about 10 seconds and then seg faults.

I've attached a capture of my test. I searched the mailing list and found a report that was strikingly similar to my problem (14th March);

http://gcc.gnu.org/ml/java/2003-03/msg00231.html

And following the trail the problem appears to have been patched on 31st March;

http://gcc.gnu.org/ml/java/2003-03/msg00409.html

Is this a regression of the alignment problem or has it not been entirely fixed yet or perhaps something else?

Toby.
[toby at linux2 testing]$ more /etc/redhat-release
Red Hat Linux release 7.3 (Valhalla)
[toby at linux2 testing]$ uname -a
Linux linux2 2.4.18-3 #1 Thu Apr 18 07:37:53 EDT 2002 i686 unknown
[toby at linux2 testing]$ gcj -v
Reading specs from /home/toby/gcjc1/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
Reading specs from /home/toby/gcjc1/lib/gcc-lib/i686-pc-linux-gnu/3.3/../../../libgcj.spec
rename spec lib to liborig
Configured with: ../gcc/configure --enable-threads=posix --prefix=/home/toby/gcjc1 --enable-shared --enable-languages=c++,java : (reconfigured) ../gcc/configure --enable-threads --prefix=/home/toby/gcjc1 --enable-shared --enable-languages=c++,java
Thread model: posix
gcc version 3.3 20030414 (prerelease)
[toby at linux2 testing]$ ls -al
total 24
drwxrwxr-x    2 toby     toby         4096 Apr 15 02:49 .
drwxrwxr-x   11 toby     toby         4096 Apr 14 23:49 ..
-rw-rw-r--    1 toby     toby          107 Apr 14 23:28 Test1.java
[toby at linux2 testing]$ more Test1.java
public class Test1 {

  public static void main(String[] args) {
    new Error().printStackTrace();
  }

}
[toby at linux2 testing]$ gcj --main=Test1 -o Test1 Test1.java
[toby at linux2 testing]$ ls -al
total 44
drwxrwxr-x    2 toby     toby         4096 Apr 15 02:51 .
drwxrwxr-x   11 toby     toby         4096 Apr 14 23:49 ..
-rwxrwxr-x    1 toby     toby        17566 Apr 15 02:51 Test1
-rw-rw-r--    1 toby     toby          107 Apr 14 23:28 Test1.java
[toby at linux2 testing]$ ./Test1
Segmentation fault
[toby at linux2 testing]$ gdb ./Test1
GNU gdb Red Hat Linux (5.1.90CVS-5)
Copyright 2002 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 "i386-redhat-linux"...
(gdb) run
Starting program: /home/toby/gcj/mckoi_compile/mckoi-sql/testing/Test1
[New Thread 1024 (LWP 1029)]
[New Thread 2049 (LWP 1036)]
[New Thread 1026 (LWP 1037)]

Program received signal SIGPIPE, Broken pipe.
[Switching to Thread 1024 (LWP 1029)]
0x420dace4 in write () from /lib/i686/libc.so.6
(gdb) where
#0  0x420dace4 in write () from /lib/i686/libc.so.6
#1  0x40846b18 in __DTOR_END__ () from /lib/i686/libpthread.so.0
#2  0x403a49f6 in java::io::FileDescriptor::write(JArray<char>*, int, int) (this=0x813e670, b=0x8148ea8,
    offset=62, len=62) at java/io/natFileDescriptor.cc:165
#3  0x403d6f46 in java.io.FileOutputStream.write(byte[], int, int) (this=0xffffffe0, b=0x8148ea0,
    off=135564968, len=62) at ../../../gcc/libjava/java/io/FileOutputStream.java:87
#4  0x403d0b5c in java.io.BufferedOutputStream.flush() (this=0x8141870)
    at ../../../gcc/libjava/java/io/BufferedOutputStream.java:141
#5  0x403e4295 in java.io.OutputStreamWriter.flush() (this=0x8148ea0)
    at ../../../gcc/libjava/java/io/OutputStreamWriter.java:83
#6  0x403d1a66 in java.io.BufferedWriter.flush() (this=0x8148ea0)
    at ../../../gcc/libjava/java/io/BufferedWriter.java:121
#7  0x404255ef in gnu.gcj.runtime.NameFinder.demangleName(java.lang.String) (this=0x8148ea0, s=0x8137c78)
    at ../../../gcc/libjava/gnu/gcj/runtime/NameFinder.java:435
#8  0x404253bf in gnu.gcj.runtime.NameFinder.createStackTraceElement(java.lang.String, java.lang.String) (
    this=0xffffffe0, name=0x8141870, file=0x8136a00)
    at ../../../gcc/libjava/gnu/gcj/runtime/NameFinder.java:376
#9  0x403a265b in gnu::gcj::runtime::NameFinder::dladdrLookup(gnu::gcj::RawData*, int) (this=0xffffffe0,
    addrs=0xffffffe0, n=62) at ../../../gcc/libjava/gcj/cni.h:64
#10 0x40424c77 in gnu.gcj.runtime.NameFinder.lookup(gnu.gcj.RawData, int) (this=0x8095be0, addrs=0x8136a00,
    n=-1073745264) at ../../../gcc/libjava/gnu/gcj/runtime/NameFinder.java:209
#11 0x40424e23 in gnu.gcj.runtime.NameFinder.lookup(java.lang.Throwable, gnu.gcj.RawData, int) (
    this=0x8095be0, t=0xffffffe0, addrs=0x80b5ae0, length=14)
    at ../../../gcc/libjava/gnu/gcj/runtime/NameFinder.java:256
#12 0x403d02ef in java.lang.VMThrowable.getStackTrace(java.lang.Throwable) (this=0xbffff290, t=0xffffffe0)
    at ../../../gcc/libjava/java/lang/VMThrowable.java:100
#13 0x403cfbbc in java.lang.Throwable.getStackTrace() (this=0xbffff290)
    at ../../../gcc/libjava/java/lang/Throwable.java:516
#14 0x403cf860 in java.lang.Throwable.stackTraceString() (this=0xbffff290)
    at ../../../gcc/libjava/java/lang/Throwable.java:412
#15 0x403cf7c5 in java.lang.Throwable.printStackTrace(java.io.PrintStream) (this=0xffffffe0, s=0x809fea0)
    at ../../../gcc/libjava/java/lang/Throwable.java:365
#16 0x403cf78a in java.lang.Throwable.printStackTrace() (this=0x809fea0)
    at ../../../gcc/libjava/java/lang/Throwable.java:354
#17 0x080489a7 in Test1.main(java.lang.String[]) ()
#18 0x403a23cf in gnu::gcj::runtime::FirstThread::call_main() (this=0x80cff50)
---Type <return> to continue, or q <return> to quit---
    at ../../../gcc/libjava/gnu/gcj/runtime/natFirstThread.cc:46
#19 0x40424568 in gnu.gcj.runtime.FirstThread.run() (this=0x80cff50)
    at ../../../gcc/libjava/gnu/gcj/runtime/FirstThread.java:54
#20 0x403b0a0c in _Jv_ThreadRun(java::lang::Thread*) (thread=0x809fea0)
    at ../../../gcc/libjava/java/lang/natThread.cc:285
#21 0x4038824c in _Jv_RunMain(java::lang::Class*, char const*, int, char const**, bool) (klass=0x8049b40,
    name=0x0, argc=135069520, argv=0x809fea0, is_jar=false) at ../../../gcc/libjava/prims.cc:978
#22 0x4038837d in JvRunMain (klass=0xffffffe0, argc=-32, argv=0xffffffe0) at ../../../gcc/libjava/prims.cc:988
#23 0x08048964 in main ()
#24 0x42017499 in __libc_start_main () from /lib/i686/libc.so.6
(gdb) quit
The program is running.  Exit anyway? (y or n) y

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