Re: very elusive ml-build issue

Dave Herman <[email protected]> Mon, 19 Feb 2007 20:38:29 -0500
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
>     % ./codegen.pl 1500 > main.sml
>     % ml-build test.cm Main.main test.heap

Update: the bug still exists in the current svn sources, but I had to 
increase the test size a bit. I reproduced the bug with:

     % ./codegen.pl 2000 > main.sml
     % ml-build -Ctdp.instrument=true \$smlnj-tdp/back-trace.cm test.cm 
Main.main test.heap

I've also been instrumenting the runtime; the problem occurs within 
LoadBinFile in base/runtime/kernel/boot.c. Running the above test on 
WinXP/Cygwin, I observed this behavior:

     boot.c:492   thisSzB == 201879 (relatively large, but not huge)
     boot.c:493   dataObj successfully allocated
     boot.c:496   calls SaveCState
       - msp->ml_calleeSave[0] gets mutated
       - had OBJ_LEN 1, now has OBJ_LEN 2
     boot.c:497   calls BuildLiterals
       - msp->ml_calleeSave[0] is trashed -- now has OBJ_LEN 16758485!
     boot.c:499   calls RestoreCState -- never returns

So something in between the SaveCState and RestoreCState is going wrong 
and causing RestoreCState to crash.

Dave

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV