<div dir="ltr">Hi Nicolas,<div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 20, 2017 at 5:56 PM, Eliot Miranda <span dir="ltr"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Nicolas,<div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 20, 2017 at 3:45 PM, Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@<wbr>gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br><div dir="ltr"><div><div><div><div>Thanks Eliot for pushing WIN64 ABI further!<br><br></div>So the failure is this one:<br><br>gdb: unknown target exception 0xc0000028 at 0x774c8078<br><br>Program received signal ?, Unknown signal.<br>0x00000000774c8078 in ntdll!RtlRaiseStatus () from /cygdrive/c/Windows/SYSTEM32/n<wbr>tdll.dll<br>(gdb) where<br>#0  0x00000000774c8078 in ntdll!RtlRaiseStatus () from /cygdrive/c/Windows/SYSTEM32/n<wbr>tdll.dll<br>#1  0x0000000077467eb6 in ntdll!TpAlpcRegisterCompletion<wbr>List () from /cygdrive/c/Windows/SYSTEM32/n<wbr>tdll.dll<br>#2  0x000007fefe08e5a3 in msvcrt!longjmp () from /cygdrive/c/Windows/system32/m<wbr>svcrt.dll<br>#3  0x0000000000419502 in ceReturnToInterpreter (anOop=176164968) at ../../spur64src/vm/gcc3x-coint<wbr>erp.c:16504<br>#4  0x000000000a801086 in ?? ()<br>Backtrace stopped: previous frame inner to this frame (corrupt stack?)<br><br></div>I now suspect the jmp_buf alignment problem that I had to workaround in jpeg plugin:<br></div>It must be aligned on 16 bytes boundary in Win64, but sometimes the compiler fails to honour this requirement<br></div>See <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/120" target="_blank">https://github.com/OpenSmallta<wbr>lk/opensmalltalk-vm/pull/120</a></div></blockquote><div><br></div><div>Hmph.  So the stack /should/ be aligned on a 16-byte boundary and hence the compiler /should/ be able to maintain the invariant (see platforms/Cross/vm/<wbr>sqCogStackAlignment.h; in fact on Mac OS X the alignment is 32 bytes).</div><div> </div><div>Let me suggest that you add the following to the preamble:</div><div><br></div><div><div>#if WIN64</div><div># define sigsetjmp(jb,ssmf) (assert(((int)jb & 15) == 0, setjmp(jb))</div><div># define siglongjmp(jb,v) (assert(((int)jb & 15) == 0, longjmp(jb,v))</div></div><div>#elif WIN32</div><div>...</div><div><br></div><div>and make sure there's a self assertCStackWellAligned send in ceReturnToInterpreter.</div></div></div></div></blockquote><div><br></div><div>Hmmm.  I expect we need code in the ceReturnToInterpreterTrampoline that establishes the stack alignment requirement.  ceReturnToInterpreter: would be called from machine code where there is only 8 byte alignment on x64 (& 4 byte alignment on 32-bit VMs).  If you like I can try and implement this tomorrow.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote">2017-03-19 21:03 GMT+01:00 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>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>And currently <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/spur64src/vm/cogitX64.c" target="_blank">https://github.com/OpenSmallta<wbr>lk/opensmalltalk-vm/blob/Cog/s<wbr>pur64src/vm/cogitX64.c</a> is generated for SysV only.<br></div>It's necessary to hack the CogX64Compiler SysV class var initialization and generate a win64 specific cogitX64.c.<br><br></div><div class="gmail-m_4452455029169383820gmail-m_3136833395563508300HOEnZb"><div class="gmail-m_4452455029169383820gmail-m_3136833395563508300h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-03-19 20:34 GMT+01:00 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>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi Clement,<br></div>it's been a while since I last tested, but in a few words:<br></div>- win64 use it's own ABI<br></div>- we have to assign the registers differently than sysV<br></div>- the experiments I did resulted in VM crashing early (before opening window)<br><br></div>Nicolas<br><div><div><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-19 20:29 GMT+01:00 Clément Bera <span dir="ltr"><<a href="mailto:bera.clement@gmail.com" target="_blank">bera.clement@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br><div dir="ltr">Thank you very much for doing Nicolas. It is very important for many Pharo users to use Pharo 64 bits on Windows.<div><br></div><div>What are the problems you have when trying to build the VM with the JIT that you don't have when building the stack VM ? Is it about API to make the memory executable, is it about calling conventions ?</div></div><div><div class="gmail-m_4452455029169383820gmail-m_3136833395563508300m_1282566188950751948h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 19, 2017 at 12:14 PM, 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-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br><div dir="ltr">And the appveyor builds are green<br><a href="https://ci.appveyor.com/project/OpenSmalltalk/vm/build/1.0.579" target="_blank">https://ci.appveyor.com/projec<wbr>t/OpenSmalltalk/vm/build/1.0.5<wbr>79</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-19 17:31 GMT+01:00 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>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Hi,<br></div>I've built a 64bits pharo.stack.spur VM for windows on my machine,<br></div>and I'm uploading the changes to opensmalltalk-vm in branch <br></div>build_pharo_win32_with_cygwin<br><br></div>If the appveyor job correctly succeed, I will emit a pull request.<br><br>The VM does not have the SqueakSSL plugin yet.<br><br></div>The 64bits squeak/pharo.cog.spur JIT for windows is still to come,<br></div>but I did not work on it for a few months...<br></div><div>One thing at a time.<br></div><div><br></div><div>Let's cross finger<span class="gmail-m_4452455029169383820gmail-m_3136833395563508300m_1282566188950751948m_-8406071533041255915m_-3727487575268912687m_2521325081379501837HOEnZb"><font color="#888888"><br><br></font></span></div><span class="gmail-m_4452455029169383820gmail-m_3136833395563508300m_1282566188950751948m_-8406071533041255915m_-3727487575268912687m_2521325081379501837HOEnZb"><font color="#888888"><div>Nicolas<br></div></font></span></div>
</blockquote></div><br></div>
<br></blockquote></div><br></div>
<br></div></div></blockquote></div><br></div></div></div></div></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
<br></blockquote></div><span class="gmail-HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="gmail-m_4452455029169383820gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>