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]

Re: Threads and co


Here further investigations (still on darwin):
I'm stuck and don't understand.

The example I take is the Throw_1.java from the testsuite.
Comments in the gdb output below.

Here the latest output, any help would be great.

Thanks in advance.

Andreas

-------

[titanium:~/tst/testsuite/libjava.lang] andreast% ./Throw_1
Bus error

(gdb) bt
#0  _Unwind_SjLj_Resume (exc=0x66b580) at 
/Volumes/xufs/gccsrc/gcc/gcc/unwind.inc:224
#1  0x00002630 in _ZN7Throw_14mainEP6JArrayIPN4java4lang6StringEE 
(args=0x0) at Throw_1.java:12
#2  0x00058a88 in _ZN3gnu3gcj7runtime11FirstThread9call_mainEv 
(this=0x66b580) at 
/Volumes/xufs/gccsrc/gcc/libjava/gnu/gcj/runtime/natFirstThread.cc:46
#3  0x00026010 in _ZN3gnu3gcj7runtime11FirstThread3runEv (this=0x66b580) 
at /Volumes/xufs/gccsrc/gcc/libjava/gnu/gcj/runtime/FirstThread.java:54
#4  0x00025274 in _Z13_Jv_ThreadRunPN4java4lang6ThreadE 
(thread=0x66b580) at 
/Volumes/xufs/gccsrc/gcc/libjava/java/lang/natThread.cc:285
#5  0x00004468 in _Z11_Jv_RunMainPN4java4lang5ClassEPKciPS4_b 
(klass=0x158088, name=0x0, argc=1, argv=0xbffff76c, is_jar=false) at 
/Volumes/xufs/gccsrc/gcc/libjava/prims.cc:1010
#6  0x00004628 in JvRunMain (klass=0x8, argc=0, argv=0x4a415641) at 
/Volumes/xufs/gccsrc/gcc/libjava/prims.cc:1020
#7  0x0000247c in main (argc=???, argv=???) at /var/tmp/ccFrQmqR.i:0
#8  0x0000237c in _start ()
#9  0x000021ac in start ()
(gdb)

(gdb) r
Starting program: /Users/andreast/tst/testsuite/libjava.lang/Throw_1
[Switching to thread 1 (process 27769 thread 0x1503)]
Reading symbols for shared libraries . done

Program received signal EXC_BAD_ACCESS, Could not access memory.
_Unwind_SjLj_Resume (exc=0x66b580) at 
/Volumes/xufs/gccsrc/gcc/gcc/unwind.inc:224
224       if (exc->private_1 == 0)
(gdb) p exc
$1 = (struct _Unwind_Exception *) 0x66b580
(gdb) p *exc
$2 = {
   exception_class = 6080505460031488,
   exception_cleanup = 0x666ba0,
   private_1 = 6711568,
   private_2 = 0
}
(gdb) up
#1  0x00002630 in _ZN7Throw_14mainEP6JArrayIPN4java4lang6StringEE 
(args=null) at Throw_1.java:12
12            Throwable t = get ();
Current language:  auto; currently java
(gdb) up
#2  0x00058a88 in _ZN3gnu3gcj7runtime11FirstThread9call_mainEv 
(this=0x66b580) at 
/Volumes/xufs/gccsrc/gcc/libjava/gnu/gcj/runtime/natFirstThread.cc:46
46        (*real_main) (args);
Current language:  auto; currently c++
(gdb) p meth->ncode
$3 = (void *) 0xd9e1ff78
(gdb) p real_main
$4 = (main_func *) 0x7fffdead
(gdb)

What I do not understand is this code from 
libjava/gnu/gcj/runtime/natFirstThread.cc:46

   main_func *real_main = (main_func *) meth->ncode;
   (*real_main) (args);

The meth->ncode contains a reasonable value (see below), but the 
real_main contains rubbish.

(gdb) p args
$5 = 0x7 <Address 0x7 out of bounds>
(gdb) p *args
Cannot access memory at address 0x7
(gdb)
(gdb) p *meth
$6 = {
   name = 0x7c0802a6,
   signature = 0x7d800026,
   accflags = 55745,
   index = 65392,
   ncode = 0xd9e1ff78,
   throws = 0xda01ff80
}
(gdb)







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