<div>Hi!</div><div> </div><div> </div><div> ( Possible duplicate my commentary in Issue #47 on GitHub )</div><div> </div><div> </div><div>>><div><div>>>C:\s\cm3\m3-libs\m3core\src\win32\WinBase.i3(1231):<*EXTERNAL ExitProcess:WINAPI*></div><div>>>C:\s\cm3\m3-libs\m3core\src\win32\WinBase.i3(1232):PROCEDURE ExitProcess (uExitCode: UINT32);</div><div><div>>></div></div><div>>>Voila.</div><div><div>>></div></div><div>>>ExitProcess is declared as taking an unsigned integer but we pass negative.</div></div></div><div> </div><div> </div><div><div><div> As temporary solution, please, implement this patch:</div><div> </div><div>==</div><div>--- m3-libs\m3core\src\runtime\WIN32\RTOS.m3 000 Sun Jan 03 11:17:00 2016</div><div>+++ m3-libs\m3core\src\runtime\WIN32\RTOS.m3 Thu Feb 25 12:31:36 2021</div><div>@@ -23,10 +23,11 @@</div><div> IF WinBase.IsDebuggerPresent () # 0 THEN</div><div> WinBase.DebugBreak ();</div><div> END;</div><div>- RTThread.SuspendOthers ();</div><div>- RTMachInfo.DumpStack (LOOPHOLE (Crash, ADDRESS), fp);</div><div>- RTSignal.RestoreHandlers (); (* so we really do crash... *)</div><div>- Exit (-1);</div><div>+ (*** RTThread.SuspendOthers (); ***)</div><div>+ (*** RTMachInfo.DumpStack (LOOPHOLE (Crash, ADDRESS), fp); *) ***)</div><div>+ (*** RTThread.ResumeOthers (); ***)</div><div>+ (*** RTSignal.RestoreHandlers (); (* so we really do crash... *) ***)</div><div>+ Exit (4000);</div><div> END Crash;</div><div> </div><div> (*********************</div><div>==</div></div></div><div> </div><div>Best regards, Victor Miasnikov</div><div> </div><div>25.02.2021, 08:37, "Jay K" <jayk123@hotmail.com>:</div><blockquote><div dir="ltr">
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
Ok it seems like a bug in reporting of assertion failures.
<div><br />
</div>
<div>The repro is:</div>
<div><br />
</div>
<div>\python27\python boot1.py PA32_HPUX c</div>
<div><br />
</div>
<div>or</div>
<div><br />
</div>
<div>\bin\amd64\windbg /g /G /o \python27\python boot1.py PA32_HPUX c</div>
<div><br />
</div>
<div>which its an assertion failure in the C backend, I will look into.</div>
<div><br />
</div>
<div> IF WinBase.IsDebuggerPresent () # 0 THEN</div>
<div> WinBase.DebugBreak ();</div>
<div> END;</div>
<div><br />
</div>
<div>3:013> k</div>
<div> # Child-SP RetAddr Call Site</div>
<div> KERNELBASE!DebugBreak</div>
<div><span class="1f1ea193f6735cf0wmi-callto">02 000000</span>bc`984fd2c0 00007ff6`4baa2e9f cm3!RTOS__Crash+0x43 [C:\s\cm3\m3-libs\m3core\src\runtime\WIN32\RTOS.m3 @ 26]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">03 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">310 00007</span>ff6`4bad0b4f cm3!RTProcess__Crash+0x6f [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTProcess.m3 @ 66]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">04 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">350 00007</span>ff6`4bad0780 cm3!RTError__EndError+0x3f [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTError.m3 @ 119]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">05 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">390 00007</span>ff6`4bae8cd7 cm3!RTError__MsgS+0xa0 [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTError.m3 @ 41]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">06 000000</span>bc`984fd3d0 00007ff6`4bae88de cm3!RTException__Crash+0x317 [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 81]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">07 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">460 00007</span>ff6`4bae87cb cm3!RTException__DefaultBackstop+0xce [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 39]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">08 000000</span>bc`984fd4d0 00007ff6`4bae90ca cm3!RTException__InvokeBackstop+0x3b [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 25]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">09 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">510 00007</span>ff6`4bae89aa cm3!RTException__Raise+0x9a [C:\s\cm3\m3-libs\m3core\src\runtime\ex_frame\RTExFrame.m3 @ 90]
</div>
<div>0a 000000bc`984fd<span class="1f1ea193f6735cf0wmi-callto">570 00007</span>ff6`4bae87cb cm3!RTException__DefaultBackstop+0x19a [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 49]
</div>
<div>0b 000000bc`984fd5e0 00007ff6`4bae90ca cm3!RTException__InvokeBackstop+0x3b [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 25]
</div>
<div>0c 000000bc`984fd<span class="1f1ea193f6735cf0wmi-callto">620 00007</span>ff6`4babb4fe cm3!RTException__Raise+0x9a [C:\s\cm3\m3-libs\m3core\src\runtime\ex_frame\RTExFrame.m3 @ 90]
</div>
<div>0d 000000bc`984fd<span class="1f1ea193f6735cf0wmi-callto">680 00007</span>ff6`4b71aeca cm3!RTHooks__ReportFault+0xfe [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTHooks.m3 @ 112]
</div>
<div>0e 000000bc`984fd<span class="1f1ea193f6735cf0wmi-callto">720 00007</span>ff6`4b7050f7 cm3!M_M3C_L_166_CRASH+0x1a [C:\s\cm3\m3-sys\m3back\AMD64_NT\M3C.m3.c @ 31094]
</div>
<div><br />
</div>
<div>C backend assertion failure here:</div>
<div><br />
</div>
<div>0f 000000bc`984fd<span class="1f1ea193f6735cf0wmi-callto">750 00007</span>ff6`4b7038d4 cm3!M3C__TIntLiteral+0x5a7 [C:\s\cm3\m3-sys\m3back\src\M3C.m3 @ 4830]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">10 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">800 00007</span>ff6`4b703997 cm3!M3C__init_int+0x2b4 [C:\s\cm3\m3-sys\m3back\src\M3C.m3 @ 4658]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">11 000000</span>bc`984fd8b0 00007ff6`4ba0b759 cm3!M3C__Segments_init_int+0x97 [C:\s\cm3\m3-sys\m3back\src\M3C.m3 @ 4668]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">12 000000</span>bc`984fd8f0 00007ff6`4ba10079 cm3!M3CG_MultiPass__replay_init_int+0x89 [C:\s\cm3\m3-sys\m3middle\src\M3CG_MultiPass.m3 @ 1234]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">13 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">940 00007</span>ff6`4b6f285c cm3!M3CG_MultiPass__Replay+0x649 [C:\s\cm3\m3-sys\m3middle\src\M3CG_MultiPass.m3 @ 250]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">14 000000</span>bc`984fda<span class="1f1ea193f6735cf0wmi-callto">30 00007</span>ff6`4ba1d983 cm3!M3C__multipass_end_unit+0x7ac [C:\s\cm3\m3-sys\m3back\src\M3C.m3 @ 2374]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">15 000000</span>bc`984fdb<span class="1f1ea193f6735cf0wmi-callto">30 00007</span>ff6`4b84174d cm3!M3CG_Check__end_unit+0x113 [C:\s\cm3\m3-sys\m3middle\src\M3CG_Check.m3 @ 365]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">16 000000</span>bc`984fdba0 00007ff6`4b7f77c1 cm3!CG__End_unit+0x11d [C:\s\cm3\m3-sys\m3front\src\misc\CG.m3 @ 192]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">17 000000</span>bc`984fdbf0 00007ff6`4b7dea9c cm3!Module__Compile+0x511 [C:\s\cm3\m3-sys\m3front\src\values\Module.m3 @ 931]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">18 000000</span>bc`984fdc<span class="1f1ea193f6735cf0wmi-callto">80 00007</span>ff6`4b7ddace cm3!M3Front__DoCompile+0xb3c [C:\s\cm3\m3-sys\m3front\src\misc\M3Front.m3 @ 220]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">19 000000</span>bc`984fddb0 00007ff6`4b6b2472 cm3!M3Front__Compile+0x32e [C:\s\cm3\m3-sys\m3front\src\misc\M3Front.m3 @ 67]
</div>
<div>1a 000000bc`984fde<span class="1f1ea193f6735cf0wmi-callto">50 00007</span>ff6`4b6b0186 cm3!Builder__RunM3Front+0x6c2 [C:\s\cm3\m3-sys\cm3\src\Builder.m3 @ 1972]
</div>
<div>1b 000000bc`984fdf<span class="1f1ea193f6735cf0wmi-callto">10 00007</span>ff6`4b6af0ab cm3!Builder__PushOneM3+0x816 [C:\s\cm3\m3-sys\cm3\src\Builder.m3 @ 1618]
</div>
<div>1c 000000bc`984fe<span class="1f1ea193f6735cf0wmi-callto">180 00007</span>ff6`4b6ac058 cm3!Builder__CompileM3+0x33b [C:\s\cm3\m3-sys\cm3\src\Builder.m3 @ 1407]
</div>
<div>1d 000000bc`984fe1e0 00007ff6`4b6b2e8b cm3!Builder__CompileOne+0x2a8 [C:\s\cm3\m3-sys\cm3\src\Builder.m3 @ 1102]
</div>
<div>1e 000000bc`984fe<span class="1f1ea193f6735cf0wmi-callto">290 00007</span>ff6`4b6b2279 cm3!Builder__Pass0_CheckImports+0x16b [C:\s\cm3\m3-sys\cm3\src\Builder.m3 @ 2017]
</div>
<div>1f 000000bc`984fe2f0 00007ff6`4b6b0186 cm3!Builder__RunM3Front+0x4c9 [C:\s\cm3\m3-sys\cm3\src\Builder.m3 @ 1957]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">20 000000</span>bc`984fe3b0 00007ff6`4b6af0ab cm3!Builder__PushOneM3+0x816 [C:\s\cm3\m3-sys\cm3\src\Builder.m3 @ 1618]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">21 000000</span>bc`984fe<span class="1f1ea193f6735cf0wmi-callto">620 00007</span>ff6`4b6ac058 cm3!Builder__CompileM3+0x33b [C:\s\cm3\m3-sys\cm3\src\Builder.m3 @ 1407]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">22 000000</span>bc`984fe<span class="1f1ea193f6735cf0wmi-callto">680 00007</span>ff6`4b6ab958 cm3!Builder__CompileOne+0x2a8 [C:\s\cm3\m3-sys\cm3\src\Builder.m3 @ 1102]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">23 000000</span>bc`984fe<span class="1f1ea193f6735cf0wmi-callto">730 00007</span>ff6`4b6a50b2 cm3!Builder__CompileEverything+0x2b8 [C:\s\cm3\m3-sys\cm3\src\Builder.m3 @ 1047]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">24 000000</span>bc`984fe<span class="1f1ea193f6735cf0wmi-callto">930 00007</span>ff6`4b6a2df8 cm3!Builder__CompileUnits+0x1222 [C:\s\cm3\m3-sys\cm3\src\Builder.m3 @ 359]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">25 000000</span>bc`984fea<span class="1f1ea193f6735cf0wmi-callto">20 00007</span>ff6`4b6ccf57 cm3!Builder__BuildLib+0x58 [C:\s\cm3\m3-sys\cm3\src\Builder.m3 @ 40]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">26 000000</span>bc`984fea<span class="1f1ea193f6735cf0wmi-callto">80 00007</span>ff6`4b7b538c cm3!M3Build__DoLibrary+0x227 [C:\s\cm3\m3-sys\cm3\src\M3Build.m3 @ 1466]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">27 000000</span>bc`984feb<span class="1f1ea193f6735cf0wmi-callto">70 00007</span>ff6`4b7b3b22 cm3!QMachine__DoCall+0x80c [C:\s\cm3\m3-sys\m3quake\src\QMachine.m3 @ 547]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">28 000000</span>bc`984fec<span class="1f1ea193f6735cf0wmi-callto">50 00007</span>ff6`4b7c0289 cm3!QMachine__Eval+0x2152 [C:\s\cm3\m3-sys\m3quake\src\QMachine.m3 @ 422]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">29 000000</span>bc`984feec0 00007ff6`4b7c000a cm3!QMachine__IncludeFile+0x269 [C:\s\cm3\m3-sys\m3quake\src\QMachine.m3 @ 1774]
</div>
<div>2a 000000bc`984ff0c0 00007ff6`4b6c6a6d cm3!QMachine__Include+0x2a [C:\s\cm3\m3-sys\m3quake\src\QMachine.m3 @ 1745]
</div>
<div>2b 000000bc`984ff<span class="1f1ea193f6735cf0wmi-callto">100 00007</span>ff6`4b6c97dd cm3!M3Build__Include+0xfd [C:\s\cm3\m3-sys\cm3\src\M3Build.m3 @ 679]
</div>
<div>2c 000000bc`984ff1a0 00007ff6`4b7b538c cm3!M3Build__DoIncludeDir+0xfd [C:\s\cm3\m3-sys\cm3\src\M3Build.m3 @ 1055]
</div>
<div>2d 000000bc`984ff<span class="1f1ea193f6735cf0wmi-callto">210 00007</span>ff6`4b7b3b22 cm3!QMachine__DoCall+0x80c [C:\s\cm3\m3-sys\m3quake\src\QMachine.m3 @ 547]
</div>
<div>2e 000000bc`984ff2f0 00007ff6`4b7b19ba cm3!QMachine__Eval+0x2152 [C:\s\cm3\m3-sys\m3quake\src\QMachine.m3 @ 422]
</div>
<div>2f 000000bc`984ff<span class="1f1ea193f6735cf0wmi-callto">560 00007</span>ff6`4b7cc3fd cm3!QMachine__Evaluate+0x7a [C:\s\cm3\m3-sys\m3quake\src\QMachine.m3 @ 166]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">30 000000</span>bc`984ff5a0 00007ff6`4b6c408b cm3!Quake__Run+0xdd [C:\s\cm3\m3-sys\m3quake\src\Quake.m3 @ 20]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">31 000000</span>bc`984ff<span class="1f1ea193f6735cf0wmi-callto">600 00007</span>ff6`4b6e5818 cm3!M3Build__Run+0x11b [C:\s\cm3\m3-sys\cm3\src\M3Build.m3 @ 243]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">32 000000</span>bc`984ff<span class="1f1ea193f6735cf0wmi-callto">640 00007</span>ff6`4b6e4a02 cm3!Main__DoIt+0xd88 [C:\s\cm3\m3-sys\cm3\src\Main.m3 @ 117]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">33 000000</span>bc`984ff9e0 00007ff6`4baa1ab7 cm3!Main_M3+0x22 [C:\s\cm3\m3-sys\cm3\src\Main.m3 @ 231]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">34 000000</span>bc`984ffa<span class="1f1ea193f6735cf0wmi-callto">20 00007</span>ff6`4baa1d3b cm3!RTLinker__RunMainBody+0x3e7 [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTLinker.m3 @ 408]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">35 000000</span>bc`984ffac0 00007ff6`4baa14b8 cm3!RTLinker__AddUnitI+0x11b [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTLinker.m3 @ 116]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">36 000000</span>bc`984ffb<span class="1f1ea193f6735cf0wmi-callto">00 00007</span>ff6`4b6a1038 cm3!RTLinker__AddUnit+0x118 [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTLinker.m3 @ 125]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">37 000000</span>bc`984ffb<span class="1f1ea193f6735cf0wmi-callto">60 00007</span>ff6`4bb12974 cm3!main+0x38 [C:\s\cm3\m3-sys\cm3\AMD64_NT\_m3main.c @ 23]
</div>
<div>38 (Inline Function) --------`-------- cm3!invoke_main+0x22 [d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 78]
</div>
<div><br />
</div>
<div><br />
</div>
<div>which if you go past the breakpoint, which simulates no debugger, it hits the assertion failure</div>
<div>I reported:</div>
<div><br />
</div>
<div>3:013> k</div>
<div><br />
</div>
<div>. 13 Id: a35c.8d38 Suspend: 1 Teb: 000000bc`982c8000 Unfrozen</div>
<div> # Child-SP RetAddr Call Site</div>
<div> KERNELBASE!DebugBreak</div>
<div><span class="1f1ea193f6735cf0wmi-callto">02 000000</span>bc`984fc8f0 00007ff6`4baa2e9f cm3!RTOS__Crash+0x43 [C:\s\cm3\m3-libs\m3core\src\runtime\WIN32\RTOS.m3 @ 26]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">03 000000</span>bc`984fc<span class="1f1ea193f6735cf0wmi-callto">940 00007</span>ff6`4bad0b4f cm3!RTProcess__Crash+0x6f [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTProcess.m3 @ 66]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">04 000000</span>bc`984fc<span class="1f1ea193f6735cf0wmi-callto">980 00007</span>ff6`4bad0780 cm3!RTError__EndError+0x3f [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTError.m3 @ 119]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">05 000000</span>bc`984fc9c0 00007ff6`4bae8cd7 cm3!RTError__MsgS+0xa0 [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTError.m3 @ 41]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">06 000000</span>bc`984fca<span class="1f1ea193f6735cf0wmi-callto">00 00007</span>ff6`4bae88de cm3!RTException__Crash+0x317 [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 81]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">07 000000</span>bc`984fca<span class="1f1ea193f6735cf0wmi-callto">90 00007</span>ff6`4bae87cb cm3!RTException__DefaultBackstop+0xce [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 39]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">08 000000</span>bc`984fcb<span class="1f1ea193f6735cf0wmi-callto">00 00007</span>ff6`4bae90ca cm3!RTException__InvokeBackstop+0x3b [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 25]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">09 000000</span>bc`984fcb<span class="1f1ea193f6735cf0wmi-callto">40 00007</span>ff6`4bae89aa cm3!RTException__Raise+0x9a [C:\s\cm3\m3-libs\m3core\src\runtime\ex_frame\RTExFrame.m3 @ 90]
</div>
<div>0a 000000bc`984fcba0 00007ff6`4bae87cb cm3!RTException__DefaultBackstop+0x19a [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 49]
</div>
<div>0b 000000bc`984fcc<span class="1f1ea193f6735cf0wmi-callto">10 00007</span>ff6`4bae90ca cm3!RTException__InvokeBackstop+0x3b [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 25]
</div>
<div>0c 000000bc`984fcc<span class="1f1ea193f6735cf0wmi-callto">50 00007</span>ff6`4babb4fe cm3!RTException__Raise+0x9a [C:\s\cm3\m3-libs\m3core\src\runtime\ex_frame\RTExFrame.m3 @ 90]
</div>
<div>0d 000000bc`984fccb0 00007ff6`4bac003a cm3!RTHooks__ReportFault+0xfe [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTHooks.m3 @ 112]
</div>
<div><br />
</div>
<div>The ThreadWin32 assertion failure.</div>
<div><br />
</div>
<div>0e 000000bc`984fcd<span class="1f1ea193f6735cf0wmi-callto">50 00007</span>ff6`4babbf09 cm3!M_ThreadWin32_L_137_CRASH+0x1a [C:\s\cm3\m3-libs\m3core\AMD64_NT\ThreadWin32.m3.c @ 4356]
</div>
<div>0f 000000bc`984fcd<span class="1f1ea193f6735cf0wmi-callto">80 00007</span>ff6`4bae8e28 cm3!RTThread__SuspendOthers+0x89 [C:\s\cm3\m3-libs\m3core\src\thread\WIN32\ThreadWin32.m3 @ 799]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">10 000000</span>bc`984fcdf0 00007ff6`4baa2e9f cm3!RTOS__Crash+0x48 [C:\s\cm3\m3-libs\m3core\src\runtime\WIN32\RTOS.m3 @ 27]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">11 000000</span>bc`984fce<span class="1f1ea193f6735cf0wmi-callto">40 00007</span>ff6`4bad0b4f cm3!RTProcess__Crash+0x6f [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTProcess.m3 @ 66]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">12 000000</span>bc`984fce<span class="1f1ea193f6735cf0wmi-callto">80 00007</span>ff6`4bad0780 cm3!RTError__EndError+0x3f [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTError.m3 @ 119]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">13 000000</span>bc`984fcec0 00007ff6`4bae8cd7 cm3!RTError__MsgS+0xa0 [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTError.m3 @ 41]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">14 000000</span>bc`984fcf<span class="1f1ea193f6735cf0wmi-callto">00 00007</span>ff6`4bae88de cm3!RTException__Crash+0x317 [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 81]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">15 000000</span>bc`984fcf<span class="1f1ea193f6735cf0wmi-callto">90 00007</span>ff6`4bae87cb cm3!RTException__DefaultBackstop+0xce [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 39]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">16 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">000 00007</span>ff6`4bae90ca cm3!RTException__InvokeBackstop+0x3b [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 25]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">17 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">040 00007</span>ff6`4bae89aa cm3!RTException__Raise+0x9a [C:\s\cm3\m3-libs\m3core\src\runtime\ex_frame\RTExFrame.m3 @ 90]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">18 000000</span>bc`984fd0a0 00007ff6`4bae87cb cm3!RTException__DefaultBackstop+0x19a [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 49]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">19 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">110 00007</span>ff6`4bae90ca cm3!RTException__InvokeBackstop+0x3b [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 25]
</div>
<div>1a 000000bc`984fd<span class="1f1ea193f6735cf0wmi-callto">150 00007</span>ff6`4babb4fe cm3!RTException__Raise+0x9a [C:\s\cm3\m3-libs\m3core\src\runtime\ex_frame\RTExFrame.m3 @ 90]
</div>
<div>1b 000000bc`984fd1b0 00007ff6`4bae8f4a cm3!RTHooks__ReportFault+0xfe [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTHooks.m3 @ 112]
</div>
<div>1c 000000bc`984fd<span class="1f1ea193f6735cf0wmi-callto">250 00007</span>ff6`4bae8dc4 cm3!M_RTOS_L_15_CRASH+0x1a [C:\s\cm3\m3-libs\m3core\AMD64_NT\RTOS.m3.c @ 544]
</div>
<div>1d 000000bc`984fd<span class="1f1ea193f6735cf0wmi-callto">280 00007</span>ff6`4bae8e4a cm3!RTOS__Exit+0x44 [C:\s\cm3\m3-libs\m3core\src\runtime\WIN32\RTOS.m3 @ 16]
</div>
<div>1e 000000bc`984fd2c0 00007ff6`4baa2e9f cm3!RTOS__Crash+0x6a [C:\s\cm3\m3-libs\m3core\src\runtime\WIN32\RTOS.m3 @ 30]
</div>
<div>1f 000000bc`984fd<span class="1f1ea193f6735cf0wmi-callto">310 00007</span>ff6`4bad0b4f cm3!RTProcess__Crash+0x6f [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTProcess.m3 @ 66]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">20 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">350 00007</span>ff6`4bad0780 cm3!RTError__EndError+0x3f [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTError.m3 @ 119]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">21 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">390 00007</span>ff6`4bae8cd7 cm3!RTError__MsgS+0xa0 [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTError.m3 @ 41]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">22 000000</span>bc`984fd3d0 00007ff6`4bae88de cm3!RTException__Crash+0x317 [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 81]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">23 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">460 00007</span>ff6`4bae87cb cm3!RTException__DefaultBackstop+0xce [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 39]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">24 000000</span>bc`984fd4d0 00007ff6`4bae90ca cm3!RTException__InvokeBackstop+0x3b [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 25]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">25 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">510 00007</span>ff6`4bae89aa cm3!RTException__Raise+0x9a [C:\s\cm3\m3-libs\m3core\src\runtime\ex_frame\RTExFrame.m3 @ 90]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">26 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">570 00007</span>ff6`4bae87cb cm3!RTException__DefaultBackstop+0x19a [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 49]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">27 000000</span>bc`984fd5e0 00007ff6`4bae90ca cm3!RTException__InvokeBackstop+0x3b [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 25]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">28 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">620 00007</span>ff6`4babb4fe cm3!RTException__Raise+0x9a [C:\s\cm3\m3-libs\m3core\src\runtime\ex_frame\RTExFrame.m3 @ 90]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">29 000000</span>bc`984fd<span class="1f1ea193f6735cf0wmi-callto">680 00007</span>ff6`4b71aeca cm3!RTHooks__ReportFault+0xfe [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTHooks.m3 @ 112]
</div>
<div>2a 000000bc`984fd<span class="1f1ea193f6735cf0wmi-callto">720 00007</span>ff6`4b7050f7 cm3!M_M3C_L_166_CRASH+0x1a [C:\s\cm3\m3-sys\m3back\AMD64_NT\M3C.m3.c @ 31094]
</div>
<div>2b 000000bc`984fd<span class="1f1ea193f6735cf0wmi-callto">750 00007</span>ff6`4b7038d4 cm3!M3C__TIntLiteral+0x5a7 [C:\s\cm3\m3-sys\m3back\src\M3C.m3 @ 4830]
</div>
<div><br />
</div>
<div><br />
</div>
<div>The first suspend is here:</div>
<div>3:013> k</div>
<div> # Child-SP RetAddr Call Site</div>
<div><span class="1f1ea193f6735cf0wmi-callto">00 000000</span>d3`6839d2d8 00007ff6`4bae8e28 cm3!RTThread__SuspendOthers [C:\s\cm3\m3-libs\m3core\src\thread\WIN32\ThreadWin32.m3 @ 793]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">01 000000</span>d3`6839d2e0 00007ff6`4baa2e9f cm3!RTOS__Crash+0x48 [C:\s\cm3\m3-libs\m3core\src\runtime\WIN32\RTOS.m3 @ 27]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">02 000000</span>d3`6839d<span class="1f1ea193f6735cf0wmi-callto">330 00007</span>ff6`4bad0b4f cm3!RTProcess__Crash+0x6f [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTProcess.m3 @ 66]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">03 000000</span>d3`6839d<span class="1f1ea193f6735cf0wmi-callto">370 00007</span>ff6`4bad0780 cm3!RTError__EndError+0x3f [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTError.m3 @ 119]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">04 000000</span>d3`6839d3b0 00007ff6`4bae8cd7 cm3!RTError__MsgS+0xa0 [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTError.m3 @ 41]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">05 000000</span>d3`6839d3f0 00007ff6`4bae88de cm3!RTException__Crash+0x317 [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 81]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">06 000000</span>d3`6839d<span class="1f1ea193f6735cf0wmi-callto">480 00007</span>ff6`4bae87cb cm3!RTException__DefaultBackstop+0xce [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 39]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">07 000000</span>d3`6839d4f0 00007ff6`4bae90ca cm3!RTException__InvokeBackstop+0x3b [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 25]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">08 000000</span>d3`6839d<span class="1f1ea193f6735cf0wmi-callto">530 00007</span>ff6`4bae89aa cm3!RTException__Raise+0x9a [C:\s\cm3\m3-libs\m3core\src\runtime\ex_frame\RTExFrame.m3 @ 90]
</div>
<div><span class="1f1ea193f6735cf0wmi-callto">09 000000</span>d3`6839d<span class="1f1ea193f6735cf0wmi-callto">590 00007</span>ff6`4bae87cb cm3!RTException__DefaultBackstop+0x19a [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 49]
</div>
<div>0a 000000d3`6839d<span class="1f1ea193f6735cf0wmi-callto">600 00007</span>ff6`4bae90ca cm3!RTException__InvokeBackstop+0x3b [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTException.m3 @ 25]
</div>
<div>0b 000000d3`6839d<span class="1f1ea193f6735cf0wmi-callto">640 00007</span>ff6`4babb4fe cm3!RTException__Raise+0x9a [C:\s\cm3\m3-libs\m3core\src\runtime\ex_frame\RTExFrame.m3 @ 90]
</div>
<div>0c 000000d3`6839d6a0 00007ff6`4b71aeca cm3!RTHooks__ReportFault+0xfe [C:\s\cm3\m3-libs\m3core\src\runtime\common\RTHooks.m3 @ 112]
</div>
<div>0d 000000d3`6839d<span class="1f1ea193f6735cf0wmi-callto">740 00007</span>ff6`4b7050f7 cm3!M_M3C_L_166_CRASH+0x1a [C:\s\cm3\m3-sys\m3back\AMD64_NT\M3C.m3.c @ 31094]
</div>
<div>0e 000000d3`6839d<span class="1f1ea193f6735cf0wmi-callto">770 00007</span>ff6`4b7038d4 cm3!M3C__TIntLiteral+0x5a7 [C:\s\cm3\m3-sys\m3back\src\M3C.m3 @ 4830]
</div>
<div><br />
</div>
<div><br />
</div>
<div>and then.."funny"..</div>
<div><br />
</div>
<div>PROCEDURE Crash () =</div>
<div> CONST Magic = 1 * ADRSIZE (INTEGER); (* == offset of "fp" in this frame *)</div>
<div> VAR fp: ADDRESS := ADR (fp) + Magic; (* == my frame pointer *)</div>
<div> BEGIN</div>
<div> IF WinBase.IsDebuggerPresent () # 0 THEN</div>
<div> WinBase.DebugBreak ();</div>
<div> END;</div>
<div> RTThread.SuspendOthers (); <== probably the first suspend</div>
<div> RTMachInfo.DumpStack (LOOPHOLE (Crash, ADDRESS), fp);</div>
<div> RTSignal.RestoreHandlers (); (* so we really do crash... *)</div>
<div> Exit (-1); <== it gets here</div>
<div> END Crash;</div>
<div><br />
</div>
<div>PROCEDURE Exit (n: INTEGER) = <== and then here</div>
<div> BEGIN</div>
<div> WinBase.ExitProcess (n); </div>
<div> END Exit;</div>
<div><br />
</div>
<div><br />
</div>
<div>and it is our recent friend, a range fault on the exit code.</div>
<div><br />
</div>
<div>0f 000000d3`6839d2a0 00007ff6`4bae8e4a cm3!RTOS__Exit(</div>
<div>int64 n_L_17 = 0n-1)+0x44 [C:\s\cm3\m3-libs\m3core\src\runtime\WIN32\RTOS.m3 @ 16]
</div>
<div><br />
</div>
<div><br />
</div>
<div>3:013> u cm3!RTOS__Exit</div>
<div>cm3!RTOS__Exit [C:\s\cm3\m3-libs\m3core\src\runtime\WIN32\RTOS.m3 @ 18]:</div>
<div>00007ff6`4bae8d<span class="1f1ea193f6735cf0wmi-callto">80 48894</span>c2408 mov qword ptr [rsp+8],rcx</div>
<div>00007ff6`4bae8d85 4883ec38 sub rsp,38h</div>
<div>00007ff6`4bae8d89 48c<span class="1f1ea193f6735cf0wmi-callto">744242000000000</span> mov qword ptr [rsp+20h],0</div>
<div>00007ff6`4bae8d92 488d442428 lea rax,[rsp+28h]</div>
<div>00007ff6`4bae8d<span class="1f1ea193f6735cf0wmi-callto">97 4889442428</span> mov qword ptr [rsp+28h],rax</div>
<div>00007ff6`4bae8d9c 488b442440 mov rax,qword ptr [rsp+40h]</div>
<div>00007ff6`4bae8da<span class="1f1ea193f6735cf0wmi-callto">1 4889442420</span> mov qword ptr [rsp+20h],rax</div>
<div>00007ff6`4bae8da6 48837c242000 cmp qword ptr [rsp+20h],0</div>
<div>3:013> u</div>
<div>cm3!RTOS__Exit+0x2c [C:\s\cm3\m3-libs\m3core\src\runtime\WIN32\RTOS.m3 @ 16]:</div>
<div>00007ff6`4bae8dac 7c0c jl cm3!RTOS__Exit+0x3a (00007ff6`4bae8dba)</div>
<div>00007ff6`4bae8dae b8ffffffff mov eax,0FFFFFFFFh</div>
<div>00007ff6`4bae8db<span class="1f1ea193f6735cf0wmi-callto">3 4839442420</span> cmp qword ptr [rsp+20h],rax</div>
<div>00007ff6`4bae8db8 7e0a jle cm3!RTOS__Exit+0x44 (00007ff6`4bae8dc4)</div>
<div>00007ff6`4bae8dba b<span class="1f1ea193f6735cf0wmi-callto">901020000</span> mov ecx,201h</div>
<div>00007ff6`4bae8dbf e86c010000 call cm3!M_RTOS_L_15_CRASH (00007ff6`4bae8f30) <== here</div>
<div>00007ff6`4bae8dc4 8b4c2420 mov ecx,dword ptr [rsp+20h]</div>
<div><br />
</div>
<div><br />
</div>
<div>C:\s\cm3\m3-libs\m3core\src\win32\WinBase.i3(1231):<*EXTERNAL ExitProcess:WINAPI*></div>
<div>C:\s\cm3\m3-libs\m3core\src\win32\WinBase.i3(1232):PROCEDURE ExitProcess (uExitCode: UINT32);</div>
<div><br />
</div>
<div>Voila.</div>
<div><br />
</div>
<div>ExitProcess is declared as taking an unsigned integer but we pass negative.</div>
<div><br />
</div>
<div>So again I think we are being somehow overzealous regarding integer ranges.</div>
<div><br />
</div>
<div>I mean, I get, that quality is important and this seems correct, based on</div>
<div>some simple principles, but the result seems very unsatifactory.</div>
<div><br />
</div>
<div><br />
</div>
<div>On the 32bit system this is Word.T and you can pass any INTEGER value, there are</div>
<div>no checks I guess, and it works.</div>
<div><br />
</div>
<div><br />
</div>
<div>But the extension to a 64bit system adds checks and not all INTEGER values are valid,</div>
<div>not even ones that fit in 32bits like -1.</div>
<div><br />
</div>
<div><br />
</div>
<div>Would it make sense to declare a type with the "1.5" range -2^31..2^32?</div>
<div><br />
</div>
<div>Again, I am tempted to change to plain 64bit INTEGER. But that changes e.g.</div>
<div>the type of taking the address.</div>
<div>Pass any value that fits in a register, with the understanding, perhaps not known,</div>
<div>that the upper 32bits are silently ignored???</div>
<div><br />
</div>
<div>I realize is an exit upon an assertion failure, so it doesn't really matter,</div>
<div>in this case, but Exit(-1) imho should be portable between Win32 and Win64.</div>
<div><br />
</div>
<div>I know I could say Exit(16_ffffffff) or have a wrapper that does Word.And(Last(UINT32))</div>
<div>but I don't think these should be needed. -1 should be portable between 32bit and 64bit.</div>
<div><br />
</div>
<div>Please help me to understand and advise what to do?<br />
</div>
<div><br />
</div>
<div><span style="margin:0px">The nested suspend should probably be relaxed somehow too?</span><br />
<span style="margin:0px"></span><br />
</div>
- Jay<br />
</div>
<div>
<div id="dd8fcbc3886f6beba9d56dd35eeb1be5appendonsend"></div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
<br />
</div>
<hr style="display:inline-block;width:98%" />
<div id="f2e387f28ef856c18dfa722bbcbb9bfadivRplyFwdMsg" dir="ltr"><font color="#000000" face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b> M3devel <<a href="mailto:m3devel-bounces@elegosoft.com">m3devel-bounces@elegosoft.com</a>> on behalf of Jay K <<a href="mailto:jayk123@hotmail.com">jayk123@hotmail.com</a>><br />
<b>Sent:</b> Thursday, February 25, 2021 4:48 AM<br />
<b>To:</b> m3devel <<a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a>><br />
<b>Subject:</b> [M3devel] win32 <* ASSERT suspend_cnt = 0 *> ?</font>
<div> </div>
</div>
<div dir="ltr">
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
Today I ran:
<div><br />
</div>
<div>for /f %a in (targets.txt) do .\boot1.py %a c</div>
<div><br />
</div>
<div>It worked a lot, and then a lot of:</div>
<div><br />
</div>
<div><br />
</div>
<div><br />
</div>
<div>***</div>
<div>*** runtime error:</div>
<div>*** <*ASSERT*> failed.</div>
<div>*** file "..\src\thread\WIN32\ThreadWin32.m3", line 798</div>
<div>***</div>
<div><br />
</div>
<div><br />
</div>
<div>which is here:</div>
<div><br />
</div>
<div>PROCEDURE SuspendOthers () =</div>
<div> (* LL=0. Always bracketed with ResumeOthers which releases "activeLock". *)</div>
<div> VAR me: Activation;</div>
<div> act: Activation;</div>
<div> retry: BOOLEAN;</div>
<div> BEGIN</div>
<div> EnterCriticalSection(ADR(activeLock));</div>
<div><br />
</div>
<div> <* ASSERT suspend_cnt = 0 *> <---</div>
<div> INC (suspend_cnt);</div>
<div> IF suspend_cnt # 1 THEN</div>
<div> RETURN</div>
<div> END;</div>
<div><br />
</div>
<div><br />
</div>
<div>any ideas?</div>
<div><br />
</div>
<div>This is AMD64_NT.</div>
<div><br />
</div>
<div>I'll try to reproduce it under a debugger.</div>
<div>The code looks a little odd, in that it seems prepared for the assertion failure.</div>
<div><br />
</div>
<div>Thank you,</div>
- Jay<br />
</div>
</div>
</div>
</div>
,<p>_______________________________________________<br />M3devel mailing list<br /><a href="mailto:M3devel@elegosoft.com">M3devel@elegosoft.com</a><br /><a href="https://m3lists.elegosoft.com/mailman/listinfo/m3devel">https://m3lists.elegosoft.com/mailman/listinfo/m3devel</a><br /></p></blockquote>