[Bug 71] NullPointerException with GGC

[email protected]
Newsgroups gmane.comp.java.vm.sablevm.bugs
Message-ID <[email protected]>
http://sablevm.org/bugs/show_bug.cgi?id=71





------- Additional Comments From [email protected]  2004-10-28 19:18 -------
gadek@gadek:/tmp$ /home/gadek/work/usr/bin/sablevm -V
SableVM version staging+2980
- compile date and time: 2004-10-28 23:04:22 UTC
- gcc version: 3.3.4 (Debian 1:3.3.4-13)
- debugging checks enabled
- generational copying garbage collection
^^^^^^^^^^^^^^^
- bidirectional object layout
- switch threaded interpreter

gadek@gadek:/tmp$ gdb /home/gadek/work/usr/bin/sablevm
GNU gdb 6.1-debian
Copyright 2004 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-linux"...Using host libthread_db library
"/lib/tls/libthread_db.so.1".

(gdb) set args -Y MenuDriven
(gdb) run
Starting program: /home/gadek/work/usr/bin/sablevm -Y MenuDriven
[Thread debugging using libthread_db enabled]
[New Thread 1076164992 (LWP 23334)]
[New Thread 1113066416 (LWP 23337)]
[New Thread 1128410032 (LWP 23340)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1113066416 (LWP 23337)]
0x40069c4a in _svmf_interpreter (_env=0x809dfd0) at instructions_switch.c:8959
8959              method =
(gdb) bt
#0  0x40069c4a in _svmf_interpreter (_env=0x809dfd0) at instructions_switch.c:8959
#1  0x4002b736 in _svmh_invoke_static_virtualmachine_runthread (env=0x809dfd0)
at method_invoke.c:5189
#2  0x40020e92 in _svmf_thread_start (_env=0x809dfd0) at thread.c:1141
#3  0x402419b4 in start_thread () from /lib/tls/libpthread.so.0
#4  0x00000000 in ?? ()
(gdb) print instance
$1 = (_svmt_object_instance *) 0x40275d48
(gdb) print instance->vtable
$2 = (_svmt_vtable *) 0x5
(gdb) print method_offset
$3 = 64
(gdb) print ((char *) instance->vtable) + method_offset
$4 = 0x45 <Address 0x45 out of bounds>

There's no need to choose anything from the menu (which causes 
NullPointerExceptions because of unimplemented features in Classpath, but
is otherwise normal), just click on menu once, and then just "move the mouse
around" displaying different elements of menu back and forth.

It segfaults in INVOKEVIRTUAL, at this code:

          method =
            *((_svmt_method_info **)
              (((char *) instance->vtable) + method_offset));

It looks like the value in vtable is damaged (see printout of variables'
values provided from gdb above).

The same experiment with SableVM compiled with copying GC causes no
segfaults.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are the QA contact for the bug, or are watching the QA contact.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.