<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>It is normal to get an exception here -- I think cm3 looks in current working directory..not great but that's how it is.<BR>That is how I know my stuff is working -- exceptions are a normal part of operation. If you break them, you know it quickly.<BR> <BR> <BR>Anyway, you need to go back to a working cm3 + cm3cg + config + libm3 + m3core and run upgrade.py.<BR>Nothing else is going to work. (ok, maybe upgrade.sh works, but I didn't try it.)<BR> <BR> <BR>The interface here between cm3's generated code/data and m3core has changed.<BR>You cannot mix them. It will fail.<BR> <BR> <BR> - Jay<br><br><br><br> <BR><div>> Date: Sat, 22 Aug 2015 11:41:14 -0500<br>> From: rodney_bates@lcwb.coop<br>> To: m3devel@elegosoft.com; jay.krell@cornell.edu<br>> Subject: Re: [M3devel] cm3 is broken: More info<br>> <br>> <br>> <br>> On 08/22/2015 11:33 AM, Rodney M. Bates wrote:<br>> > There are at least two problems. The runaway recursion happens in RTExFrame.m3:175<br>> ><br>> > PROCEDURE InvokeHandler (f: Frame; READONLY a: RT0.RaiseActivation) RAISES ANY =<br>> > VAR p := LOOPHOLE (f, PF1);<br>> > BEGIN<br>> > IF DEBUG THEN<br>> > PutExcept ("INVOKE HANDLER", a);<br>> > RTIO.PutText (" frame="); RTIO.PutAddr (f);<br>> > RTIO.PutText (" class="); RTIO.PutInt (f.class);<br>> > RTIO.PutText ("\n");<br>> > RTIO.Flush ();<br>> > END;<br>> > RTThread.SetCurrentHandlers (f.next); (* cut to the new handler *)<br>> > p.info := a; (* copy the exception to the new frame *)<br>> > <* ASSERT p.jmpbuf # NIL *><br>> > ------^^^^^^^^^^^^^^^^^^^^^^^^^^^ This assertion fails and tries to raise another fault.<br>> > Csetjmp.ulongjmp (p.jmpbuf, 1); (* and jump... *)<br>> > RAISE OUCH;<br>> > END InvokeHandler;<br>> ><br>> > (m3gdb) frame 0<br>> > #0 InvokeHandler (f=16_00007fff509f4af0, a=<br>> > RECORD exception = 16_00007ff696883aa0; arg = 16_00000000013e4ae8; module = 16_00007ff6968a3060; line = 50; pc = NIL; info0 = NIL; info1 = NIL; un_except = NIL; un_arg = NIL; END) at ../src/runtime/ex_frame/RTExFrame.m3:175<br>> > 175 <* ASSERT p.jmpbuf # NIL *><br>> > (m3gdb) p p.jmpbuf<br>> > $31 = NIL<br>> > --------^^^<br>> > (m3gdb)<br>> ><br>> ><br>> > The original problem starts in FSPosix.m3:328, when cm3.cfg is not found:<br>> ><br>> > PROCEDURE Status(pn: Pathname.T): File.Status RAISES {OSError.E} =<br>> > VAR status: File.Status; fname := M3toC.SharedTtoS(pn);<br>> > BEGIN<br>> > IF CStatus(fname, status) < 0 THEN Fail(pn, fname); END;<br>> > ---------^^^^^^^^^^^^^^^^^^^^^^<br>> > M3toC.FreeSharedS(pn, fname);<br>> > RETURN status<br>> > END Status;<br>> ><br>> > (m3gdb)<br>> > #6 0x00007ff696593c14 in Status (pn=16_00000000013e4ac0, _result=RECORD type = 16_0000000000000001; modificationTime = ; size = 1; END)<br>> > at ../src/os/POSIX/FSPosix.m3:328<br>> > 328 IF CStatus(fname, status) < 0 THEN Fail(pn, fname); END;<br>> > (m3gdb) p pn<br>> > $30 = (*16_00000000013e4ac0*) "./cm3.cfg"<br>> > --------------------------------^^^^^^^^^^^<br>> > (m3gdb)<br>> ><br>> > I have a cm3.cfg beside cm3, where it should be. Could the current directory be wrong?<br>> <br>> A bit more info:<br>> <br>> (m3gdb) down<br>> #6 0x00007ff696593c14 in Status (pn=16_00000000013e4ac0, _result=RECORD type = 16_0000000000000001; modificationTime = ; size = 1; END)<br>> at ../src/os/POSIX/FSPosix.m3:328<br>> 328 IF CStatus(fname, status) < 0 THEN Fail(pn, fname); END;<br>> (m3gdb) p Process.GetWorkingDirectory()<br>> $32 = (*16_0000000001420170*) "/home/rodney/proj/m3/exp/trytemp/src"<br>> --------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>> (m3gdb)<br>> <br>> This is where I ran cm3 from.<br>> <br>> <br>> ><br>> > Also, I notice one other thing, that probably isn't part of this problem, but maybe needs<br>> > to be fixed. Fail, when called from Status, uses Cerrno.GetErrno in a separate call,<br>> > after the failing CStatus above. Obviously not thread safe. Does it matter here?<br>> > As I recall from many years ago, there was a change in C library that provided a thread<br>> > safe alternative to this, and I even think I had to change something in pm3 or SRC to<br>> > adapt to it. Do we care?<br>> ><br>> > PROCEDURE Fail(p: Pathname.T; f: Ctypes.char_star) RAISES {OSError.E} =<br>> > VAR err := Cerrno.GetErrno();<br>> > ---------------^^^^^^^^^^^^^^^^^<br>> > BEGIN<br>> > M3toC.FreeSharedS(p, f);<br>> > OSErrorPosix.Raise0(err);<br>> > END Fail;<br>> ><br>> ><br>> ><br>> > On 08/19/2015 05:20 PM, Rodney M. Bates wrote:<br>> >> As of a recent pull from modula3-cm3, done around 16:00 CDT, cm3 is going into<br>> >> runaway recursion trying to report a fault. This happens immediately upon<br>> >> running it, before it produces any output.<br>> >><br>> >> Here is one cycle of the backtrace:<br>> >><br>> >> #1745 0x00007fd9b0b0d935 in _m3_fault (arg=5600) from /usr/local/cm3-uniboot/bin/../lib/libm3core.so.5<br>> >> #1746 0x00007fd9b0b0d05d in InvokeHandler (f=16_00007fff488bcc20, a=<br>> >> RECORD exception = 16_00007fd9b0d4b780; arg = 16_000000000000001d; module = 16_00007fd9b0d62d40; line = 14; pc = NIL; info0 = NIL; info1 = NIL; un_except = NIL; un_arg = NIL; END) at ../src/runtime/ex_frame/RTExFrame.m3:175<br>> >> #1747 0x00007fd9b0b0cef1 in ResumeRaise (a=<br>> >> RECORD exception = 16_00007fd9b0d4b780; arg = 16_000000000000001d; module = 16_00007fd9b0d62d40; line = 14; pc = NIL; info0 = NIL; info1 = NIL; un_except = NIL; un_arg = NIL; END) at ../src/runtime/ex_frame/RTExFrame.m3:145<br>> >> #1748 0x00007fd9b0b0ccfe in Raise (act=<br>> >> RECORD exception = 16_00007fd9b0d4b780; arg = 16_000000000000001d; module = 16_00007fd9b0d62d40; line = 14; pc = NIL; info0 = NIL; info1 = NIL; un_except = NIL; un_arg = NIL; END) at ../src/runtime/ex_frame/RTExFrame.m3:91<br>> >> #1749 0x00007fd9b0ae9693 in Raise (ex=16_00007fd9b0d4b780, arg=16_000000000000001d, module=16_00007fd9b0d62d40, line=14)<br>> >> at ../src/runtime/common/RTHooks.m3:79<br>> >> #1750 0x00007fd9b0ae9951 in Self () at ../src/runtime/common/RuntimeError.m3:14<br>> >> #1751 0x00007fd9b0ae96ef in ReportFault (module=16_00007fd9b0d6a520, info=5600) at ../src/runtime/common/RTHooks.m3:98<br>> >> #1752 0x00007fd9b0b0d935 in _m3_fault (arg=5600) from /usr/local/cm3-uniboot/bin/../lib/libm3core.so.5<br>> >><br>> >> So far, I haven't had the patience to keep hitting return until I get to the bottom of it.<br>> >><br>> ><br>> <br>> -- <br>> Rodney Bates<br>> rodney.m.bates@acm.org<br>> _______________________________________________<br>> M3devel mailing list<br>> M3devel@elegosoft.com<br>> https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel<br></div> </div></body>
</html>