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: GCJ and C++ (calling Java from C++)


Now that I have a 32bit build I can debug and here's a print of the klass 
variable. I hope someone out there can decode this and point me where to 
look.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1450252512 (LWP 16599)]
0x55bb2402 in _Jv_Linker::verify_class (klass=0x804d6e0) at link.cc:1573
1573      klass->engine->verify(klass);
(gdb) p *klass
$1 = {<> = {<No data fields>}, static class$ = {<> = {<No data fields>}, 
static class$ = <same as static member of an already seen type>,
    next_or_version = 0x5626ff40, name = 0x56045276, accflags = 17, superclass 
= 0x562f1de0, constants = {size = 8, tags = 0x562e8728 "", data = 
0x562f5480},
    methods = 0x562f2080, method_count = 53, vtable_method_count = 41, fields 
= 0x0, size_in_bytes = 140, field_count = 0, static_field_count = 0,
    vtable = 0x562f24c8, otable = 0x0, otable_syms = 0x0, atable = 0x0, 
atable_syms = 0x0, itable = 0x0, itable_syms = 0x0, catch_classes = 
0x562e8710,
    interfaces = 0x562f206c, loader = 0x0, interface_count = 1, state = 14 
'\016', thread = 0x1, depth = 1, ancestors = 0x804f0e0, idt = 0x804f0f0,
    arrayclass = 0x454c0, protectionDomain = 0x0, assertion_table = 0x0, 
hack_signers = 0x0, chain = 0x562efc40, aux_info = 0x0, engine = 0x5647006c},
  next_or_version = 0x80061a80, name = 0x555c731a, accflags = 1537, superclass 
= 0x0, constants = {size = 3, tags = 0x555d4ae4 "", data = 0x555d66dc},
  methods = 0x555d6600, method_count = 11, vtable_method_count = -1, fields = 
0x0, size_in_bytes = 4, field_count = 0, static_field_count = 0, vtable = 
0x0,
  otable = 0x0, otable_syms = 0x0, atable = 0x0, atable_syms = 0x0, itable = 
0x0, itable_syms = 0x0, catch_classes = 0x555d4ae8, interfaces = 0x555d4ae0,
  loader = 0x0, interface_count = 1, state = 7 '\a', thread = 0x1e7e88, depth 
= 0, ancestors = 0x0, idt = 0x0, arrayclass = 0x0, protectionDomain = 0x0,
  assertion_table = 0x0, hack_signers = 0x0, chain = 0x0, aux_info = 0x0, 
engine = 0x0}
(gdb) where
#0  0x55bb2402 in _Jv_Linker::verify_class (klass=0x804d6e0) at link.cc:1573
#1  0x55bb36c9 in _Jv_Linker::wait_for_state (klass=0x804d6e0, state=9) at 
link.cc:1723
#2  0x55be48e5 in java::lang::VMClassLoader::resolveClass (klass=0x804d6e0) at 
natVMClassLoader.cc:44
#3  0x55bdba69 in java::lang::Class::initializeClass (this=0x804d6e0) at 
natClass.cc:728
#4  0x0804b4f6 in _Jv_InitClass (klass=0x804d6e0) at Class.h:581
#5  0x0804b509 in JvInitClass (cls=0x804d6e0) at cni.h:30
#6  0x0804b21d in main (argc=1, argv=0xffffac74) at main.cpp:124
(gdb) up
#1  0x55bb36c9 in _Jv_Linker::wait_for_state (klass=0x804d6e0, state=9) at 
link.cc:1723
1723                verify_class (klass);
(gdb)
#2  0x55be48e5 in java::lang::VMClassLoader::resolveClass (klass=0x804d6e0) at 
natVMClassLoader.cc:44
44            _Jv_Linker::wait_for_state (klass, JV_STATE_LINKED);
(gdb)
#3  0x55bdba69 in java::lang::Class::initializeClass (this=0x804d6e0) at 
natClass.cc:728
728           java::lang::VMClassLoader::resolveClass (this);
(gdb) p *this
$1 = {<> = {<No data fields>}, static class$ = {<> = {<No data fields>}, 
static class$ = <same as static member of an already seen type>,
    next_or_version = 0x5626ff40, name = 0x56045276, accflags = 17, superclass 
= 0x562f1de0, constants = {size = 8, tags = 0x562e8728 "", data = 
0x562f5480},
    methods = 0x562f2080, method_count = 53, vtable_method_count = 41, fields 
= 0x0, size_in_bytes = 140, field_count = 0, static_field_count = 0,
    vtable = 0x562f24c8, otable = 0x0, otable_syms = 0x0, atable = 0x0, 
atable_syms = 0x0, itable = 0x0, itable_syms = 0x0, catch_classes = 
0x562e8710,
    interfaces = 0x562f206c, loader = 0x0, interface_count = 1, state = 14 
'\016', thread = 0x1, depth = 1, ancestors = 0x804f0e0, idt = 0x804f0f0,
    arrayclass = 0x454c0, protectionDomain = 0x0, assertion_table = 0x0, 
hack_signers = 0x0, chain = 0x562efc40, aux_info = 0x0, engine = 0x5647006c},
  next_or_version = 0x80061a80, name = 0x555c731a, accflags = 1537, superclass 
= 0x0, constants = {size = 3, tags = 0x555d4ae4 "", data = 0x555d66dc},
  methods = 0x555d6600, method_count = 11, vtable_method_count = -1, fields = 
0x0, size_in_bytes = 4, field_count = 0, static_field_count = 0, vtable = 
0x0,
  otable = 0x0, otable_syms = 0x0, atable = 0x0, atable_syms = 0x0, itable = 
0x0, itable_syms = 0x0, catch_classes = 0x555d4ae8, interfaces = 0x555d4ae0,
  loader = 0x0, interface_count = 1, state = 7 '\a', thread = 0x1e7e88, depth 
= 0, ancestors = 0x0, idt = 0x0, arrayclass = 0x0, protectionDomain = 0x0,
  assertion_table = 0x0, hack_signers = 0x0, chain = 0x0, aux_info = 0x0, 
engine = 0x0}

If I comment out the JvInitClass(&Library::class$); at line 124 I get

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1450252512 (LWP 18254)]
0x55bd9d42 in _Jv_LookupInterfaceMethodIdx (klass=0x0, iface=0x0, 
method_idx=1) at natClass.cc:995
995       _Jv_IDispatchTable *cldt = klass->idt;
(gdb) where
#0  0x55bd9d42 in _Jv_LookupInterfaceMethodIdx (klass=0x0, iface=0x0, 
method_idx=1) at natClass.cc:995
#1  0x0804b231 in main (argc=1, argv=0xffffc424) at main.cpp:126
(gdb) up
#1  0x0804b231 in main (argc=1, argv=0xffffc424) at main.cpp:126
126         String * p_name = p_library->getName();
(gdb) p *p_library
$1 = <incomplete type>

I'm not sure what I can do to avoid the <incomplete type> for *p_library, but 
I guess if I could see that variable content it might give away why it fails 
here.

Lothar
-- 
Lothar Werzinger Dipl.-Ing. Univ.
framework & platform architect
Tradescape Inc.
111 West St. John Street, Suite 200
San Jose, Ca 95113
email: lothar@tradescape.biz


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