Hi Konrad,<div><br></div><div>I have added some diagnostic message when failing that early in the bootstrap in the VM. Please svn up and let me know what it prints.</div><div><br></div><div>About the SIGSEGV you get with clojure.jar, I ran the code and got the same error. After investigation, it turns out that the methods you have in that .jar are quite big (50,000 bytecodes) and the static initializer of the core__init class just crashes LLVM because the stack of the thread is not big enough.</div>
<div><br></div><div>I hate Java bytecode generators :)</div><div><br></div><div>Nicolas<br><br><div class="gmail_quote">On Fri, Apr 9, 2010 at 9:26 PM, Konrad Hinsen <span dir="ltr"><<a href="mailto:konrad.hinsen@fastmail.net">konrad.hinsen@fastmail.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 09.04.2010, at 11:28, nicolas geoffray wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
VMKit runs multiple threads (for example for GC, finalization, etc), so I need the back trace of other threads as well :)<br>
</blockquote>
<br></div>
Here it comes:<br>
<br>
Thread 4 (process 14442 thread 0x2003):<div class="im"><br>
#0 0x950be44e in __semwait_signal ()<br>
#1 0x950e93e6 in _pthread_cond_wait ()<br>
#2 0x950e8dcd in pthread_cond_wait$UNIX2003 ()<br></div>
#3 0x000be2d2 in mvm::Cond::wait (this=0x20526a4, l=0x2052670) at ctlock.cpp:151<br>
#4 0x00092275 in mvm::VirtualMachine::enqueueStart (th=0x20200000) at Object.cpp:109<br>
#5 0x000bea10 in mvm::Thread::internalThreadStart (th=0x20200000) at ctthread.cpp:275<br>
#6 0x950e8155 in _pthread_start ()<br>
#7 0x950e8012 in thread_start ()<br>
<br>
Thread 3 (process 14442 thread 0x1703):<div class="im"><br>
#0 0x950be44e in __semwait_signal ()<br>
#1 0x950e93e6 in _pthread_cond_wait ()<br>
#2 0x950e8dcd in pthread_cond_wait$UNIX2003 ()<br></div>
#3 0x000be2d2 in mvm::Cond::wait (this=0x2052614, l=0x2052630) at ctlock.cpp:151<br>
#4 0x00092154 in mvm::VirtualMachine::finalizerStart (th=0x20100000) at Object.cpp:73<br>
#5 0x000bea10 in mvm::Thread::internalThreadStart (th=0x20100000) at ctthread.cpp:275<br>
#6 0x950e8155 in _pthread_start ()<br>
#7 0x950e8012 in thread_start ()<br>
<br>
Thread 2 (process 14442 thread 0x313):<br>
#0 0x95193136 in __semwait_signal_nocancel ()<br>
#1 0x95192d1b in nanosleep$NOCANCEL$UNIX2003 ()<br>
#2 0x9518c013 in usleep$NOCANCEL$UNIX2003 ()<br>
#3 0x951a3685 in abort ()<br>
#4 0x955eb005 in __gnu_cxx::__verbose_terminate_handler ()<br>
#5 0x955e910c in __gxx_personality_v0 ()<br>
#6 0x955e914b in std::terminate ()<br>
#7 0x955e9261 in __cxa_throw ()<br>
#8 0x000130ae in j3::JavaThread::throwException (this=0x20000000, obj=0x1bcfc00) at JavaThread.cpp:73<br>
#9 0x0002352b in j3::Class::initialiseClass (this=0x20e5c60, vm=0x20525a8) at Jnjvm.cpp:249<br>
#10 0x000242e5 in j3::Jnjvm::loadBootstrap (this=0x20525a8) at Jnjvm.cpp:1134<br>
#11 0x000243f1 in j3::Jnjvm::mainJavaStart (thread=0x20000000) at Jnjvm.cpp:1246<br>
#12 0x000bea10 in mvm::Thread::internalThreadStart (th=0x20000000) at ctthread.cpp:275<br>
#13 0x950e8155 in _pthread_start ()<br>
#14 0x950e8012 in thread_start ()<br>
<br>
Thread 1 (process 14442 local thread 0x2e03):<div class="im"><br>
#0 0x950be44e in __semwait_signal ()<br>
#1 0x950e93e6 in _pthread_cond_wait ()<br>
#2 0x950e8dcd in pthread_cond_wait$UNIX2003 ()<br>
#3 0x000be2d2 in mvm::Cond::wait (this=0x20527c4, l=0x2052790) at ctlock.cpp:151<br>
#4 0x00020137 in j3::Jnjvm::waitForExit (this=0x20525a8) at Jnjvm.cpp:1225<br>
#5 0x00001cf6 in main (argc=4, argv=0xbffff070, envp=0xbffff084) at Main.cpp:47<br>
<br>
<br>
<br></div>
In the meantime I installed VMKit under Linux, where it works perfectly well for most applications I tried. However, I managed to crash it once:<br>
<br>
> j3 -cp clojure-1.1.0.jar clojure.main<br>
Stack overflow in VM code or in JNI code. If it is from<br>
the VM, it is either from the JIT, the GC or the runtime.<br>
This has to be fixed in the VM: VMKit makes sure that<br>
the bottom of the stack is always available when entering<br>
the VM.<br>
Segmentation fault<br>
<br>
There is no JNI code involved, so the stack overflow happens in the VM. Is this a bug in VMKit or just an indication that I need to change some parameter settings (memory size, ...)?<br>
<br>
If you want to check this yourself, the jar file is available at<br>
<br>
<a href="http://clojure.googlecode.com/files/clojure-1.1.0.zip" target="_blank">http://clojure.googlecode.com/files/clojure-1.1.0.zip</a><br>
<br>
Thanks,<br><font color="#888888">
Konrad.<br>
</font></blockquote></div><br></div>