<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-05-18 0:13 GMT+02:00 Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-">2017-05-16 17:00 GMT+02:00 Eliot Miranda <span dir="ltr"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span>:<br></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr">Hi Nicolas,<div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-">On Tue, May 16, 2017 at 7:10 AM, Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmai<wbr>l.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-05-15 17:39 GMT+02:00 Eliot Miranda <span dir="ltr"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr">Hi Nicolas,<div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 15, 2017 at 7:37 AM, Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmai<wbr>l.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr"><div><div><div><div><div>Hi Eliot,<br></div>I've not worked on it for a month or so, but last time I tried, the VM failed during image startup.<br></div>AFAIR, it had time to produce and execute some JIT, but I can't say more until I have access to my laptop this evening,<br></div>I've tried some crazy things like tracing every VM function thru gdb hack, unfortunately, it does not scale (slow) and also perturbates the VM.<br></div>I'll try to report ASAP.<br><br></div>There's a first thing needed before testing it:<br>either add some -DWIN64ABI compilation flag somewhere, or add these 3 lines in cogit.c preamble<br><br>#if WIN64 <br># define WIN64ABI 1<br>#endif<br></div></blockquote><div><br></div><div>I was thinking it would be natural to add it to the build.win64x64 makefiles.  But I've hacked something up to add the above to cogit.c.</div><div> </div></div></div></div></blockquote><div><div>Yes thanks, if it can work automagically then it's better.<br></div><div>About Win64 status, maybe you remember the thread opened on vm-dev in March 2017, where I mentionned the error:<br></div></div></div></div></div></blockquote><div><br></div></span><div>Ah, right.  I've reread the thread.  Thank you.  So given that the alignment assert never fails the next likely suspect is unwinding the stack on longjmp.  Since we would like to avoid the cost of unwinding the stack, and because we know there is nothing to run as we unwind the stack we should see if there is a form of longjmp that does not try to unwind the stack.  Alternatively we might have to implement our own longjmp in JIT code for this specific purpose.</div><div><br></div><div>Ben, what have you discovered about unwinding the stack during longjmp on win64?</div><br></div></div></div></blockquote><div><br></div><div>Hmm, if I stepi/nexti into longjmp then I have things like this:<br><br>(gdb)<br>0x0000000077c07c34 in ntdll!RtlUnwindEx () from /cygdrive/c/Windows/SYSTEM32/<wbr>ntdll.dll<br>(gdb)<br>0x0000000077c07c37 in ntdll!RtlUnwindEx () from /cygdrive/c/Windows/SYSTEM32/<wbr>ntdll.dll<br>(gdb)<br>0x0000000077c07c39 in ntdll!RtlUnwindEx () from /cygdrive/c/Windows/SYSTEM32/<wbr>ntdll.dll<br>(gdb)<br>0x0000000077c07c3c in ntdll!RtlUnwindEx () from /cygdrive/c/Windows/SYSTEM32/<wbr>ntdll.dll<br>(gdb)<br>0x0000000077c57eac in ntdll!<wbr>TpAlpcRegisterCompletionList () from /cygdrive/c/Windows/SYSTEM32/<wbr>ntdll.dll<br>(gdb)<br>0x0000000077c57eb1 in ntdll!<wbr>TpAlpcRegisterCompletionList () from /cygdrive/c/Windows/SYSTEM32/<wbr>ntdll.dll<br>(gdb)<br>gdb: unknown target exception 0xc0000028 at 0x77cb8078<span class="gmail-"><br><br>Program received signal ?, Unknown signal.<br></span>0x0000000077cb8078 in ntdll!RtlRaiseStatus () from /cygdrive/c/Windows/SYSTEM32/<wbr>ntdll.dll<br>(gdb)<br><br><br></div><div>Is it what you don't want to see?<br></div><div><br></div><div>I found this:<br><a href="http://www.agardner.me/golang/windows/cgo/64-bit/setjmp/longjmp/2016/02/29/go-windows-setjmp-x86.html" target="_blank">http://www.agardner.me/golang/<wbr>windows/cgo/64-bit/setjmp/<wbr>longjmp/2016/02/29/go-windows-<wbr>setjmp-x86.html</a><br><a href="https://sourceforge.net/p/mingw-w64/bugs/465/" target="_blank">https://sourceforge.net/p/<wbr>mingw-w64/bugs/465/</a><br><br></div><div>I will try the builtin... <br></div></div></div></div>
</blockquote></div><br></div><div class="gmail_extra">And with the __builtin_sjlj hardocded directly in cointerp.c the execution goes a bit further<br><br>Program received signal SIGSEGV, Segmentation fault.<br>0x00000000000008d4 in ?? ()<br>(gdb) bt<br>#0  0x00000000000008d4 in ?? ()<br>Backtrace stopped: previous frame identical to this frame (corrupt stack?)<br>(gdb) call printCallStack()<br><br>          0xefaf40 M FilePath class(Behavior)>new 0x4511150: a(n) FilePath class<br>          0xefaf70 M FilePath class>pathName:isEncoded: 0x4511150: a(n) FilePath class<br>          0xefafc0 I FilePath class>pathName: 0x4511150: a(n) FilePath class<br>          0xefb010 I FileDirectory class>setDefaultDirectory: 0x44faaa0: a(n) FileDirectory class<br>          0xefb058 I FileDirectory class>startUp 0x44faaa0: a(n) FileDirectory class<br>          0xefb088 M FileDirectory class(Behavior)>startUp: 0x44faaa0: a(n) FileDirectory class<br>          0xefb0e0 M [] in SmalltalkImage>send:toClassesNamedIn:with: 0x4553ae0: a(n) SmalltalkImage<br>          0xefb130 I OrderedCollection>do: 0x48a3808: a(n) OrderedCollection<br>          0xefb180 I SmalltalkImage>send:toClassesNamedIn:with: 0x4553ae0: a(n) SmalltalkImage<br>          0xefb1d8 I SmalltalkImage>processStartUpList: 0x4553ae0: a(n) SmalltalkImage<br>          0xefb230 I SmalltalkImage>snapshot:andQuit:withExitCode:embedded: 0x4553ae0: a(n) SmalltalkImage<br>         0x69349f0 s SmalltalkImage>snapshot:andQuit:embedded:<br>         0x6943690 s SmalltalkImage>snapshot:andQuit:<br>...<br></div></div>