<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-05-25 8:28 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"><div><div><div><div><div><div><div><div>Great, you reproduced exact same behavior.<br></div>The problem I have is effectively where to put the breakpoint.<br></div><div>I think we can believe the output of (gdb) call printCallStack()<br></div><div><br></div>I've tried other means:<br></div>- analyze direct usage of registers RCX & co from VMMaker<br>  if ever it could conflicts with WIN64 logical register assignment<br></div><div>  But I did not find anything<br></div>- compile with MSVC 2017<br></div><div>  if ever the compiler could spit different warnings and give a clue<br></div>  alas it fails very early in readImageFromFileHeapSizeStart<wbr>ingAt (during checkAssumedCompactClasses)<br></div> the failure is incomprehensible, because the debugger shows identical contents if I print:<br><br>        *((sqInt *)(classTableFirstPage+8+(51<<<wbr>3)))    140697255509608    __int64<br>        *((sqInt *)(specialObjectsOop+8+(7<<3))<wbr>)    140697255509608    __int64<br><br></div>nonetheless, the debugger enters into the if and execute<br>        invalidCompactClassError("Arra<wbr>y");<br><br></div>I'll have to debug it at assembler level, but it's driving me away from the original problem...<br></div><div class="gmail-HOEnZb"><div class="gmail-h5"><div class="gmail_extra"><br></div></div></div></blockquote><div>and machine code seems wrong:<br><br>    /* begin checkAssumedCompactClasses */<br>    if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(ClassArray) << (shiftForWord())))))) != <br>00007FF6A0E4FC30  mov         rax,qword ptr [specialObjectsOop (07FF6A1052EF8h)]  <br>00007FF6A0E4FC37  mov         rcx,qword ptr [classTableFirstPage (07FF6A1052FB8h)]  <br>00007FF6A0E4FC3E  mov         rcx,qword ptr [rcx]  <br>00007FF6A0E4FC41  cmp         qword ptr [rax+40h],rcx  <br>00007FF6A0E4FC45  je          $l2+282h (07FF6A0E4FC53h)  <br>    /* begin fetchPointer:ofObject: */<br>    longAt((GIV(classTableFirstPage) + BaseHeaderSize) + ((((usqInt)(ClassArrayCompactIndex) << (shiftForWord())))))) {<br>        invalidCompactClassError("Array");<br>00007FF6A0E4FC47  lea         rcx,[string "Array" (07FF6A0F30C14h)]  <br>00007FF6A0E4FC4E  call        invalidCompactClassError (07FF6A0C6FA95h)  <br>    }<br><br></div><div>I refuse to learn x86 assembler, but it seems that:<br>- the offset + BaseHeaderSize) + ((((usqInt)(ClassArray) << (shiftForWord())))) is OK [rax+40h] is 8+7*8<br></div><div>- the offset  BaseHeaderSize) + ((((usqInt)(ClassArrayCompactIndex) << (shiftForWord())))) is completely missing!!!<br></div><div>  I would expect 8+51*8=52*8=26*2*8<br>00007FF6A0E4FC3E  mov         rcx,qword ptr [rcx+1A0h] <br><br></div><div>At this stage, there's not much I can do with MSVC...<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5"><div class="gmail_extra"><div class="gmail_quote">2017-05-25 2:38 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"><div dir="ltr">Hi Nicolas,<div><br></div><div>    the VM gets quite far before some unknown problem in path name manipulation.  I'm drunning the debug VM under gdb via</div><div><div>(gdb) run -trace=259 trunk50-64.image</div></div><div>(See Cogit>>sendTrace: for a definition of the flags)</div><div><br></div><div>and this is the output</div><div><br></div><div>...</div><div><div>UnixFileDirectory class>pathNameDelimiter</div><div>Array(Object)>at:</div><div>BlockClosure>value:</div><div>AcornFileDirectory class>isActiveDirectoryClass</div><div>SmalltalkImage>getSystemAttrib<wbr>ute:</div><div>ByteString(String)>isString</div><div>ByteString(ArrayedCollection)><wbr>size</div><div>ByteString(ArrayedCollection)><wbr>size</div><div>SmallInteger>=</div><div>Array(Object)>at:</div><div>BlockClosure>value:</div><div>MacFileDirectory class>isActiveDirectoryClass</div><div>MacFileDirectory class>pathNameDelimiter</div><div>Character>=</div><div>Array(Object)>at:</div><div>BlockClosure>value:</div><div>DosFileDirectory class(FileDirectory class)>isActiveDirectoryClass</div><div>DosFileDirectory class>pathNameDelimiter</div><div>DosFileDirectory class(FileDirectory class)>primPathNameDelimiter</div><div>Character>=</div><div>FilePath class>pathName:</div><div>FilePath class>pathName:isEncoded:</div><div><br></div><div>Alas there's no debug information to be had:</div><div><br></div><div><div>(gdb) where</div><div>#0  0x00000000000008d4 in ?? ()</div><div>Backtrace stopped: previous frame identical to this frame (corrupt stack?)</div></div><div><br></div><div>So my next step is to put a breakpoint for the selector #pathName:isEncoded: and step from there.</div><div><br></div><div><div>(gdb) b warning</div><div>Breakpoint 1 at 0x4015d9: file ../../spur64src/vm/gcc3x-coint<wbr>erp.c, line 44.</div><div>(gdb) run -breaksel pathName:isEncoded: trunk50-64.image</div><div>The program being debugged has been started already.</div><div>Start it from the beginning? (y or n) y</div><div>Starting program: /cygdrive/z/oscogvm/build.win6<wbr>4x64/squeak.cog.spur/builddbg/<wbr>vm/Squeak.exe -breaksel pathName:isEncoded: trunk50-64.image</div><div>[New Thread 4080.0x5ec]</div><div>[New Thread 4080.0xb30]</div></div><div>etc...</div><div><br></div><div class="gmail-m_-1377233005539934344m_3167571567564994632gmail_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>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>