<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
TextUtils.mo : error LNK2001: unresolved external symbol __alloca<br>TextUtils.mo : error LNK2001: unresolved external symbol _Csetjmp__Jumpbuf_size<br>sysutils.dll : fatal error LNK1120: 2 unresolved externals<br><br>Most likely you didn't build it correctly.<br>Go back to a working cm3/m3core/libm3 and run upgrade.py.<br>There should be no longer any references to alloca of Csetjmp__Jumpbuf_size.<br>Really, Csetjmp__Jumpbuf_size should never have been a problem. That likely also indicates<br>some sort of incorrect bootstrap.<br><br><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> > Are you saying you do, or do not, want me to work further on the solving the “problem,” regardless of how we describe it ?</span></p><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"></span><br>I still want alloca to work, either via a function call or a specific m3cg method.<br>(I still don't see that RTHooks.Alloca makes better sense; I still don't see a way<br>to avoid hacking the compiler, given the custom calling convention.) <br><br>It will be difficult to test the fix until/unless m3front is changed back.<br><br> - Jay<br><br><br><hr id="stopSpelling">From: rcolebur@SCIRES.COM<br>To: m3devel@elegosoft.com<br>Date: Fri, 11 Feb 2011 18:17:15 -0500<br>Subject: Re: [M3devel] threading on Windows?<br><br>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML"><style>
.ExternalClass .ecxshape
{;}
</style><style>
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.ecxMsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.ecxecxapple-style-span
{;}
.ExternalClass span.ecxecxapple-converted-space
{;}
.ExternalClass span.ecxEmailStyle20
{font-family:'Calibri','sans-serif';color:#1F497D;}
.ExternalClass .ecxMsoChpDefault
{font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;}
.ExternalClass div.ecxWordSection1
{page:WordSection1;}
</style><div class="ecxWordSection1"><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Jay:</span></p><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Ok, I don’t mean to start a new issue or upset anyone.</span></p><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">I see you checked in some new changes. I updated to latest HEAD and tried to build, but again I get unresolved symbols beginning with m3-libs\sysutils (see attached sysutils.lst)</span></p><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">So, not sure what you mean by “it should be ok now”.</span></p><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Are you saying you do, or do not, want me to work further on the solving the “problem,” regardless of how we describe it ?</span></p><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Regards,</span></p><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Randy</span></p><p class="ecxMsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p><div><div style="border-right: medium none; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">From:</span></b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> jayk123@hotmail.com [mailto:jayk123@hotmail.com] <b>On Behalf Of </b>Jay K<br><b>Sent:</b> Friday, February 11, 2011 4:52 PM<br><b>To:</b> Tony; Coleburn, Randy<br><b>Cc:</b> m3devel<br><b>Subject:</b> RE: [M3devel] threading on Windows?</span></p></div></div><p class="ecxMsoNormal" style="margin-left: 0.5in;"> </p><p class="ecxMsoNormal" style="margin-right: 0in; margin-bottom: 12pt; margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">It isn't heap-based!<br> And saying it "leaks" is misleading. It doesn't leak how most people would consider "leak".<br> It calls _alloca. If you call _alloca in a loop, you get more and more storage, until you return from the function.<br> I understand this. Tony understand it. But calling it "leak" will mislead almost everyone else.<br>It should be ok now. But still only a temporary solution. We have to either move all the back<br>to the old way, or make the new way work.<br><br><br>As we have two implementations of many things, it is common for one or the other to break.<br>The fix is really not difficult. We can't be stuck like this on everything.<br>But granted, m3front remains confusing to me, so I am stuck for a bit<br>doing this much better.<br><br>Anyway, my time is now significantly reallocated, so it all matters less.<br><br> - Jay</span></p><div class="ecxMsoNormal" style="margin-left: 0.5in; text-align: center;" align="center"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"><hr id="ecxstopSpelling" align="center" size="2" width="100%"></span></div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">From: hosking@cs.purdue.edu<br>Date: Fri, 11 Feb 2011 16:29:43 -0500<br>To: rcolebur@SCIRES.COM<br>CC: m3devel@elegosoft.com<br>Subject: Re: [M3devel] threading on Windows?<br><br>Randy,</span></p><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> </span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">I am in complete agreement with you.</span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> </span></p><div><div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: blue;">Antony Hosking</span></span><span class="ecxapple-converted-space"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: black;"> </span></span><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: black;">|</span></span><span class="ecxapple-converted-space"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: black;"> </span></span><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: black;">Associate Professor | Computer Science | Purdue University</span></span><span style="font-size: 9pt; font-family: 'Helvetica','sans-serif'; color: black;"></span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'GillSans-Light','serif'; color: black;">305 N. University Street | West Lafayette | IN 47907 | USA</span></span><span style="font-size: 9pt; font-family: 'Helvetica','sans-serif'; color: black;"></span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: blue;">Office</span></span><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'GillSans-Light','serif'; color: black;"> +1 765 494 6001 |</span></span><span class="ecxapple-converted-space"><span style="font-size: 9pt; font-family: 'GillSans-Light','serif'; color: black;"> </span></span><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: blue;">Mobile</span></span><span class="ecxapple-converted-space"><span style="font-size: 9pt; font-family: 'GillSans-Light','serif'; color: black;"> </span></span><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'GillSans-Light','serif'; color: black;">+1 765 427 5484</span></span><span style="font-size: 9pt; font-family: 'Helvetica','sans-serif'; color: black;"></span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 9pt; font-family: 'Helvetica','sans-serif'; color: black;"> </span></p></div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 9pt; font-family: 'Helvetica','sans-serif'; color: black;"><br><br></span></p></div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> </span></p></div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> </span></p><div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">On Feb 11, 2011, at 4:26 PM, Coleburn, Randy wrote:</span></p></div><blockquote style="margin-bottom: 5pt;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> </span></p><div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Tony:</span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Thank you very much for this explanation.</span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">So, it appears that the changes introduced to support the new “heap-based jmpbuf allocation” have introduced at least 2 problems that must be solved if we are to move forward on the Windows platform, namely:</span></p></div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">1.</span><span style="font-size: 7pt; color: rgb(31, 73, 125);"> <span class="ecxapple-converted-space"> </span></span><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Space leak problem.</span></p></div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">2.</span><span style="font-size: 7pt; color: rgb(31, 73, 125);"> <span class="ecxapple-converted-space"> </span></span><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Binding to appropriate “alloca” routine on Windows platform.</span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Assuming we want to retain this new heap-based jmpbuf allocation capability, someone needs to solve these 2 problems for the Windows platform.</span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">I will begin looking at the code and see if I can make some progress on these 2 problems. Before I “do” anything, I’ll run my proposed solution thru the m3devel group first. Any further insights you or Jay can give in helping me work on the solution are welcome and appreciated.</span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Finally, let me also suggest that we all may need to revisit the conversation we had on this forum many months back about contributors making sure their changes are tested not to cause major breaks before committing them to HEAD branch. </span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Seems to me that if the “heap based jumpbuf allocation scheme” was known not to be compatible with Windows, that it should have been checked in on a different experimental branch until all the kinks could be worked out for all platforms.</span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Otherwise, without some mechanism to warn everyone of known problems on the HEAD branch, folks can easily download stuff that renders their implementation broken.</span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">If my understanding of HEAD is not the prevailing one, I for one would like clarification as to what is STABLE for checkout and use and what is UNSTABLE.</span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Regards,</span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Randy Coleburn</span></p></div><div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div><div><div style="border-right: medium none; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">From:</span></b><span class="ecxapple-converted-space"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> </span></span><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">Tony Hosking [mailto:hosking@cs.purdue.edu]<span class="ecxapple-converted-space"> </span><br><b>Sent:</b><span class="ecxapple-converted-space"> </span>Thursday, February 10, 2011 4:26 PM<br><b>To:</b><span class="ecxapple-converted-space"> </span>Coleburn, Randy<br><b>Cc:</b><span class="ecxapple-converted-space"> </span>m3devel<br><b>Subject:</b><span class="ecxapple-converted-space"> </span>Re: [M3devel] threading on Windows?</span></p></div></div></div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"> </p></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;">Hi Randy,</p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"> </p></div></div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;">A far as I know, the changes are as follows.</p></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"> </p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;">TRY blocks using setjmp/longjmp to implement the exception handling each require statically one instance of a jmpbuf. Historically, the storage for this was reserved as stack local storage (using CG.Declare_param) of the target-dependent jmpbuf size. This meant having to declare the jmp_buf accurately for the target. What Jay did was to replace the stack local with a scalar pointer local variable (also using Declare_param), and to call alloca to obtain a pointer to stack allocated jmpbuf storage. The idea was to add a level of indirection, and have the size of the jmpbuf obtained from a C variable initialized appropriately, so that targets need no longer declare their jmpbuf_size. This was intended to make porting easier. There are several problems here. First, the local pointer variable needs to be initialized *once* on entry to the procedure to the value NIL, so that we check for NIL on the first invocation of the TRY and alloca only in that case. The problem is that currently that initialization is not being performed *once* but instead on each invocation of the TRY so loops with TRY blocks in them currently have a space leak.</p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"> </p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;">The other problem was how to bind to the appropriate alloca routine. Ideally it should be inlined, and on Windows this is achieved by calling a *different* function, not called alloca. My suggestion is that making the alloca call a runtime hook will allow targets to easily redirect to the correct function. On non-Windows targets using the gcc-based backend all works out because alloca is a gcc intrinsic function that gets inlined.</p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"> </p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;">To fix the space leak problem I proposed that Marker in the M3 compiler front end m3front should track, per-procedure, the jmpbuf pointer variables as it parses or checks the program, and have a callback to initialize them at the top of the procedure during code generation. I don't think this will involve much work, but I don't currently have any spare cycles to spend on it.</p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"> </p></div></div><div><p class="ecxMsoNormal" style="margin-right: 0in; margin-bottom: 12pt; margin-left: 1in;">-- Tony</p><div><div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: blue;">Antony Hosking</span></span><span class="ecxapple-converted-space"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: black;"> </span></span><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: black;">|</span></span><span class="ecxapple-converted-space"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: black;"> </span></span><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: black;">Associate Professor | Computer Science | Purdue University</span></span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'GillSans-Light','serif'; color: black;">305 N. University Street | West Lafayette | IN 47907 | USA</span></span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: blue;">Office</span></span><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'GillSans-Light','serif'; color: black;"> +1 765 494 6001 |</span></span><span class="ecxapple-converted-space"><span style="font-size: 9pt; font-family: 'GillSans-Light','serif'; color: black;"> </span></span><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'Gill Sans','serif'; color: blue;">Mobile</span></span><span class="ecxapple-converted-space"><span style="font-size: 9pt; font-family: 'GillSans-Light','serif'; color: black;"> </span></span><span class="ecxapple-style-span"><span style="font-size: 9pt; font-family: 'GillSans-Light','serif'; color: black;">+1 765 427 5484</span></span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 9pt; font-family: 'Helvetica','sans-serif'; color: black;"> </span></p></div></div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-right: 0in; margin-bottom: 12pt; margin-left: 0.5in;"> </p></div></div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"> </p></div></div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"> </p></div><div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;">On Feb 10, 2011, at 3:59 PM, Coleburn, Randy wrote:</p></div></div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-right: 0in; margin-bottom: 12pt; margin-left: 0.5in;"> </p></div><div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Jay / Tony:</span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">I am seeing in this thread that the approach to fixing the problem is not yet agreed upon.</span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">I will be glad to help in any way I can, but right now, I am “in the dark”, both as to what change was introduced that caused the problem, and the various potential solution paths. All I know is that it has been broken for a number of weeks now.</span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">I know Jay has asked for help, and I am willing to help, but it may cost him or you some time/effort in getting me up to speed on what went wrong and the pros/cons of potential solutions. If you choose to help enlighten me, I pledge to try and put that knowledge to good use both now and in the future. Otherwise, I will have to wait for one of you to solve the problem.</span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">BTW, when I look at the linker error reports for the various packages, I’m seeing several different symbols that don’t resolve, not just the one dealing with memory allocation.</span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Regards,</span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Randy</span></p></div></div><div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p></div></div><div><div style="border-right: medium none; border-width: 3pt medium medium; border-style: solid none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;"><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">From:</span></b><span class="ecxapple-converted-space"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> </span></span><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">Tony Hosking [mailto:hosking@cs.purdue.edu]<span class="ecxapple-converted-space"> </span><br><b>Sent:</b><span class="ecxapple-converted-space"> </span>Thursday, February 10, 2011 3:33 PM<br><b>To:</b><span class="ecxapple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br><b>Cc:</b><span class="ecxapple-converted-space"> </span>Coleburn, Randy; m3devel<br><b>Subject:</b><span class="ecxapple-converted-space"> </span>Re: [M3devel] threading on Windows?</span></p></div></div></div></div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"> </p></div></div><p class="ecxMsoNormal" style="margin-right: 0in; margin-bottom: 12pt; margin-left: 1.5in;">Why is it better? Because rebinding to a different function is just a matter of changing an INTERFACE in the libraries, rather than hacking the compiler.</p><div><div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;">On Feb 10, 2011, at 6:01 AM,<span class="ecxapple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><span class="ecxapple-converted-space"> </span>wrote:</p></div></div></div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-right: 0in; margin-bottom: 12pt; margin-left: 0.5in;"><br><br></p></div></div><div><div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;">1. I never understood why this any better.<br>2. It how things are currently.</p></div></div></div><div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;">3. Why not m3cg.alloca? (but see #2)</p></div></div></div><div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><br> - Jay/iPad</p></div></div></div><div><p class="ecxMsoNormal" style="margin-right: 0in; margin-bottom: 12pt; margin-left: 1.5in;"><br>On Feb 9, 2011, at 9:48 PM, Tony Hosking <<a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a>> wrote:</p></div><blockquote style="margin-bottom: 5pt;"><div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;">What happened to fixing this with runtime hooks?</p></div></div><div><p class="ecxMsoNormal" style="margin-right: 0in; margin-bottom: 12pt; margin-left: 1.5in;"> </p><div><div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;">On Feb 9, 2011, at 11:40 PM, Jay K wrote:</p></div></div></div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-right: 0in; margin-bottom: 12pt; margin-left: 0.5in;"><br><br></p></div></div><div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">Of course not.<br>It is a made-up function that the frontend generates a call to.<br>That it never previously did.<br>Using the general function call interface.<br>You need to add a special case, in the general function call code, to do something different and specific<br>for this specific function.<br> <br> <br> - Jay <br> </span></p></div></div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><div class="ecxMsoNormal" style="margin-left: 0.5in; text-align: center;" align="center"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"><hr align="center" size="2" width="100%"></span></div></div></div><p class="ecxMsoNormal" style="margin-right: 0in; margin-bottom: 12pt; margin-left: 1.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">From:<span class="ecxapple-converted-space"> </span><a href="mailto:rcolebur@SCIRES.COM">rcolebur@SCIRES.COM</a><br>To:<span class="ecxapple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a>;<span class="ecxapple-converted-space"> </span><a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><br>Date: Wed, 9 Feb 2011 22:28:45 -050<br>Subject: Re: [M3devel] threading on Windows?</span></p><div><div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Jay:</span></p></div></div></div><p class="ecxMsoNormal" style="margin-left: 1.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p><div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">I looked thru the 4,618 lines of M3x86.m3, but I don’t see any reference to “m3_alloca” or even “alloc” in this file.</span></p></div></div></div><p class="ecxMsoNormal" style="margin-left: 1.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p><div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Regards,</span></p></div></div></div><div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Randy</span></p></div></div></div><p class="ecxMsoNormal" style="margin-left: 1.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p><div><div style="border-right: medium none; border-width: 3pt medium medium; border-style: solid none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;"><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">From:</span></b><span class="ecxapple-converted-space"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> </span></span><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"><a href="mailto:jayk123@hotmail.com">jayk123@hotmail.com</a><span class="ecxapple-converted-space"> </span>[mailto:jayk123@hotmail.com]<span class="ecxapple-converted-space"> </span><b>On Behalf Of<span class="ecxapple-converted-space"> </span></b>Jay K<br><b>Sent:</b><span class="ecxapple-converted-space"> </span>Wednesday, February 09, 2011 9:01 PM<br><b>To:</b><span class="ecxapple-converted-space"> </span>Coleburn, Randy; m3devel<br><b>Subject:</b><span class="ecxapple-converted-space"> </span>RE: [M3devel] threading on Windows?</span></p></div></div></div></div></div><p class="ecxMsoNormal" style="margin-left: 2in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> </span></p><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">In m3back/src/M3x86.m3.<br> <br> - Jay<br><br> </span></p></div></div></div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><div class="ecxMsoNormal" style="margin-left: 0.5in; text-align: center;" align="center"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"><hr align="center" size="2" width="100%"></span></div></div></div></div><p class="ecxMsoNormal" style="margin-right: 0in; margin-bottom: 12pt; margin-left: 2in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">From:<span class="ecxapple-converted-space"> </span><a href="mailto:rcolebur@SCIRES.COM">rcolebur@SCIRES.COM</a><br>To:<span class="ecxapple-converted-space"> </span><a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><br>Date: Wed, 9 Feb 2011 18:22:56 -0500<br>Subject: Re: [M3devel] threading on Windows?</span></p><div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">I am certainly willing to work on the problem, but need more context info about what caused it in order to know how to resolve.</span></p></div></div></div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">All I know is that everything was working fine until I checked out the HEAD repository.</span></p></div></div></div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">When you say “special case” calls “m3_alloca”, where do I go about finding this “special case”?</span></p></div></div></div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Are we talking Modula-3 code, C code, Assembler, what? What package/module?</span></p></div></div></div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Regards,</span></p></div></div></div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Randy</span></p></div></div></div><p class="ecxMsoNormal" style="margin-left: 2in;"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);"> </span></p><div><div style="border-right: medium none; border-width: 3pt medium medium; border-style: solid none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;"><div style="margin-left: 1in;"><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">From:</span></b><span class="ecxapple-converted-space"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> </span></span><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"><a href="mailto:jayk123@hotmail.com">jayk123@hotmail.com</a><span class="ecxapple-converted-space"> </span>[mailto:jayk123@hotmail.com]<span class="ecxapple-converted-space"> </span><b>On Behalf Of<span class="ecxapple-converted-space"> </span></b>Jay K<br><b>Sent:</b><span class="ecxapple-converted-space"> </span>Wednesday, February 09, 2011 5:59 PM<br><b>To:</b><span class="ecxapple-converted-space"> </span>Coleburn, Randy; Mika Nystrom; m3devel<br><b>Subject:</b><span class="ecxapple-converted-space"> </span>RE: [M3devel] threading on Windows?</span></p></div></div></div></div></div><p class="ecxMsoNormal" style="margin-left: 2.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> </span></p><div style="margin-left: 1in;"><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">Maybe someone else can do it?<br>The fix is: special case calls to the function "m3_alloca".<br>Change it to call "_chkstk" (or maybe "chkstk", whatever works).<br>The one parameter is an unsigned 32bit quantity, passed in eax, and the return value is a pointer, returned in esp.<br>To some extent I drag my feet hoping anyone else might become motivated enough to do it and start learning how.<br> <br> - Jay<br> <br>> From:<span class="ecxapple-converted-space"> </span><a href="mailto:rcolebur@SCIRES.COM">rcolebur@SCIRES.COM</a><br>> To:<span class="ecxapple-converted-space"> </span><a href="mailto:mika@async.caltech.edu">mika@async.caltech.edu</a>;<span class="ecxapple-converted-space"> </span><a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><br>> Date: Wed, 9 Feb 2011 17:25:20 -0500<br>> Subject: Re: [M3devel] threading on Windows?<br>><span class="ecxapple-converted-space"> </span><br>> Mika:<br>><span class="ecxapple-converted-space"> </span><br>> Sorry, but my Windows build is broken. Jay seems to indicate he is working on a "fix" and that this fix is relatively simple, but so far no solution has been checked in.<br>><span class="ecxapple-converted-space"> </span><br>> I've been wanting to run your program ever since you first checked it in, but that was about same time the HEAD branch update introduced a build problem. Problem is an unresolved symbol during link.<br>><span class="ecxapple-converted-space"> </span><br>> As soon as I can get the build problem resolved, I'll try out your test program.<br>><span class="ecxapple-converted-space"> </span><br>> Regards,<br>> Randy Coleburn<br>><span class="ecxapple-converted-space"> </span><br>> -----Original Message-----<br>> From: Mika Nystrom [mailto:mika@async.caltech.edu]<span class="ecxapple-converted-space"> </span><br>> Sent: Wednesday, February 09, 2011 5:01 PM<br>> To:<span class="ecxapple-converted-space"> </span><a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><br>> Subject: [M3devel] threading on Windows?<br>><span class="ecxapple-converted-space"> </span><br>> Hi m3devel,<br>><span class="ecxapple-converted-space"> </span><br>> I'm just curious if anyone out there who's running CM3 on Windows has had<br>> a chance to try my thread testing program yet. Current status on Unix<br>> (Linux, FreeBSD) appears to be that there are problems in pthreads (but<br>> I think only under heavy load) and that user threading works perfectly.<br>> So I now wonder how things are on the third threading platform (Windows).<br>> The thread testing program is at m3-libs/m3core/tests/thread .<br>><span class="ecxapple-converted-space"> </span><br>> (Note however that there is a memory leak in TRY-EXCEPT in the current<br>> head so don't try to update everything to the CVS head. The previous<br>> release should be OK.)<br>><span class="ecxapple-converted-space"> </span><br>> Also has anyone else noticed that debugging information has recently<br>> broken? m3gdb is very unhappy on all platforms for me...<br>><span class="ecxapple-converted-space"> </span><br>> Mika</span></p></div></div></div></div></div></div></div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"> </p></div></div></div></div></blockquote></div></div><div style="margin-left: 0.5in;"><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"> </p></div></div></div></div><div style="margin-left: 0.5in;"><p class="ecxMsoNormal" style="margin-left: 0.5in;"> </p></div></div></div></blockquote></div><p class="ecxMsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> </span></p></div></div> </body>
</html>