<html>
  <head>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    I replaced the MMTk code with a C-version MMTk code (I have been
    working on such AOT compiler for a while). The compiler should deal
    with most of the MMTk code base correctly - at least I get marksweep
    running with a tiny client). So I am trying to put the C version
    MMTk back with VmKit. I tried not to change much existing code
    except where necessary, such as name mangling and MMTkObject layout.
    <br>
    <br>
    I am having the following error during building VmKit: <br>
    <blockquote>[vmkit ./tools/trainer]: Pre-compiling bootstrap code<br>
      Thread 0x110000000 received a SIGSEGV: either the VM code or an
      external<br>
      native method is bogus. Aborting...<br>
      Aborted<br>
      make[1]: ***
      [/home/yilin/vmkit/vmkit/tools/trainer/Release+Asserts/Precompiled.bc]
      Error 134<br>
      [vmkit .]: abort with error in ./tools/trainer<br>
      make: *** [all] Error 1<br>
    </blockquote>
    The stacktrace from gdb is:<br>
    <blockquote>Program received signal SIGSEGV, Segmentation fault.<br>
      [Switching to Thread 0x1100ff700 (LWP 21670)]<br>
      0x000000000107b180 in llvm::BumpPtrAllocator::Allocate(unsigned
      long, unsigned long) ()<br>
      (gdb) bt<br>
      #0  0x000000000107b180 in
      llvm::BumpPtrAllocator::Allocate(unsigned long, unsigned long) ()<br>
      #1  0x00000000005ae35d in
      j3::JavaMethod::marshalArguments(vmkit::ThreadAllocator&,
      __va_list_tag*) ()<br>
      #2  0x00000000005b04e4 in j3::JavaObject*
      j3::JavaMethod::invokeStaticAP<j3::JavaObject*, j3::JavaObject*
      (*)(j3::JavaConstantPool*, void*, void*)>(j3::Jnjvm*,
      j3::Class*, __va_list_tag*) ()<br>
      #3  0x00000000005af054 in
      j3::JavaMethod::invokeJavaObjectStatic(j3::Jnjvm*, j3::Class*,
      ...) ()<br>
      #4  0x00000000005cb662 in j3::Jnjvm::asciizToStr(char const*) ()<br>
      #5  0x00000000005cbde4 in j3::Jnjvm::CreateArithmeticException()
      ()<br>
      #6  0x00007ffff7f6316d in ?? ()<br>
      #7  0x0000000000000000 in ?? ()<br>
    </blockquote>
    The main thread was waiting in "vmkit::VirtualMachine::waitForExit()
    ()", so the application (HelloWorld) should have been started. <br>
    <br>
    1. To me, the stack trace seems not showing where the original error
    happened. It seems an arithmetic error happened somewhere, VM was
    trying to throw an exception, but met another error. Is this
    correct? And how can I track where that actual error happened? <br>
    <br>
    2. What does the precompiler do? I dont quite understand why it is
    needed here. <br>
    <br>
    Any information would be very helpful. Thanks very much.<br>
    <br>
    Regards,<br>
    Yi<br>
  </body>
</html>