gcj on OpenBSD

Kurt Miller <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
Hi,

I've been working on getting gcj up and running on OpenBSD/i386.
Currently I'm working on adding gcj to gcc 4.2 port. I'm pretty far
along with the work: enabled dwarf2 exceptions, thread model posix, etc.
The build completes but gcj-dbtool segfaults and gij too. The segfault
occurs when initializing the class loader because engine is null.

Program received signal SIGSEGV, Segmentation fault.
0x03db9548 in _Jv_Linker::verify_class (klass=@236164a0)
    at
/usr/obj/i386/ports/gcc-4.2.20070307.java/gcc-4.2-20070307/libjava/link.cc:1820
1820      klass->engine->verify(klass);
(gdb) p klass->engine
$1 = (_Jv_ExecutionEngine *) 0x0
(gdb) bt
#0  0x03db9548 in _Jv_Linker::verify_class (klass=@236164a0)
    at
/usr/obj/i386/ports/gcc-4.2.20070307.java/gcc-4.2-20070307/libjava/link.cc:1820
#1  0x03dbb2a1 in _Jv_Linker::wait_for_state (klass=@236164a0, state=9)
    at
/usr/obj/i386/ports/gcc-4.2.20070307.java/gcc-4.2-20070307/libjava/link.cc:1985
#2  0x03de3b90 in java::lang::Class::initializeClass (this=@236164a0)
    at
/usr/obj/i386/ports/gcc-4.2.20070307.java/gcc-4.2-20070307/libjava/java/lang/natClass.cc:695
#3  0x03dac322 in _Jv_CreateJavaVM (vm_args=null) at Class.h:651
#4  0x03dacc2c in _Jv_RunMain (vm_args=null, klass=@3c0de280, name=null,
    argc=3, argv=@cfbc8a08, is_jar=false)
    at
/usr/obj/i386/ports/gcc-4.2.20070307.java/gcc-4.2-20070307/libjava/prims.cc:1520
#5  0x03dace8b in _Jv_RunMain (klass=@3c0de280, name=null, argc=3,
    argv=@cfbc8a08, is_jar=Variable "is_jar" is not available.
)
    at
/usr/obj/i386/ports/gcc-4.2.20070307.java/gcc-4.2-20070307/libjava/prims.cc:1593
#6  0x03daceb9 in JvRunMain (klass=@3c0de280, argc=3, argv=@cfbc8a08)
    at
/usr/obj/i386/ports/gcc-4.2.20070307.java/gcc-4.2-20070307/libjava/prims.cc:1599
#7  0x1c002cb9 in main (argc=Cannot access memory at address 0x1
) at /tmp//cceCHhDF.i:11



(gdb) set lang java
Warning: the current language does not match this frame.
(gdb) p *klass
$2 = {<java::lang::Object> = {<_JvObjectPrefix> = {
      _vptr$_JvObjectPrefix: @2ccc5d08}, static class$: @2ccc65c0,
    sync_info: @3c107fd8}, static class$: @2ccc6300,
  next_or_version: @40062250, name: @2cb533fc, accflags: 1025,
  superclass: @2ccc65c0, constants: {size: 9, tags: @2ce33fc0,
    data: @2ce40740}, : {methods = @2ce371e0, element_type = @2ce371e0},
  method_count: 35, vtable_method_count: 31, fields: @2ce37120,
  size_in_bytes: 32, field_count: 11, static_field_count: 4,
  vtable: @2ce37088, otable: null, otable_syms: null, atable: null,
  atable_syms: null, itable: null, itable_syms: null,
  catch_classes: @2ce33fcc, interfaces: null, loader: null,
  interface_count: 0, state: 7, thread: null, depth: 1, ancestors:
@3c10aff8,
  : {idt = null, ioffsets = null}, arrayclass: null, protectionDomain: null,
  assertion_table: null, hack_signers: null, chain: null, aux_info: null,
  engine: null}

Also superclass (java::lang::Object) engine is null too:

(gdb) p *klass.superclass
$4 = {<java::lang::Object> = {<_JvObjectPrefix> = {
      _vptr$_JvObjectPrefix: @2ccc5d08}, static class$: @2ccc65c0,
    sync_info: @3c107fc0}, static class$: @2ccc6300,
  next_or_version: @40062250, name: @2ca7f642, accflags: 1, superclass:
null,
  constants: {size: 2, tags: @2ccc6444, data: @2ccc6678}, : {
    methods = @2ccc64a0, element_type = @2ccc64a0}, method_count: 14,
  vtable_method_count: 6, fields: null, size_in_bytes: 8, field_count: 0,
  static_field_count: 0, vtable: @2ccc6468, otable: null, otable_syms: null,
  atable: null, atable_syms: null, itable: null, itable_syms: null,
  catch_classes: @2ccc6448, interfaces: null, loader: null,
  interface_count: 0, state: 3, thread: null, depth: 0, ancestors: null, : {
    idt = null, ioffsets = null}, arrayclass: null, protectionDomain: null,
  assertion_table: null, hack_signers: null, chain: null, aux_info: null,
  engine: null}

Could anyone suggest some ideas for diagnosing the root cause of this?

Thanks,
-Kurt
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.