[M3devel] assertion failure in atomics

Jay K jay.krell at cornell.edu
Thu Feb 11 16:00:39 CET 2010


Type-incorrect code seems to tend to assert. But type-correct code gets through the frontend ok.

 

 - Jay
 


From: jay.krell at cornell.edu
To: hosking at cs.purdue.edu; m3devel at elegosoft.com
Date: Thu, 11 Feb 2010 13:23:45 +0000
Subject: [M3devel] assertion failure in atomics



Tony if you don't have enough to do already:
 
VAR
    <*NOWARN*>a := 1;
    <*NOWARN*>b := 2;
    <*NOWARN*>c := 3;
    <*NOWARN*>d := 4;
    <*NOWARN*>A := 5L;
    <*NOWARN*>B := 6L;
    <*NOWARN*>C := 7L;
    <*NOWARN*>D := 8L;
    bool:BOOLEAN;

PROCEDURE Test_AtomicInteger_CompareSwap() =
BEGIN
    bool := AtomicInteger.CompareSwap(a, b, c);
END Test_AtomicInteger_CompareSwap;


C:\dev2\cm3.2\m3-sys\m3tests\src\p2\p226>cm3
--- building in NT386 ---
new source -> compiling Main.m3
"..\Main.m3", line 83: incompatible types (var)

***
*** runtime error:
***    An array subscript was out of range.
***    file "..\NT386\CompareSwapInt.m3 => ..\src\builtinAtomic\CompareSwap.mg",
 line 19
***
Stack trace:
   FP         PC      Procedure
---------  ---------  -------------------------------
 0x12f3c4   0x597b9a  Check + 0x19a in ..\NT386\CompareSwapInt.m3 => ..\src\buil
tinAtomic\CompareSwap.mg
 0x12f410   0x5cd6c6  Check + 0x762 in ..\src\exprs\CallExpr.m3
 0x12f434   0x5bed4b  TypeCheck + 0x65 in ..\src\exprs\Expr.m3
 0x12f478   0x5c0570  CheckMethod + 0xd5 in ..\src\stmts\AssignStmt.m3
 0x12f498   0x5320e7  TypeCheck + 0x48 in ..\src\stmts\Stmt.m3
 0x12f4c4   0x531400  Check + 0x265 in ..\src\stmts\BlockStmt.m3
 0x12f4e4   0x5320e7  TypeCheck + 0x48 in ..\src\stmts\Stmt.m3
 0x12f554   0x4e73c4  CheckBody + 0x67d in ..\src\values\Procedure.m3
 0x12f580   0x4d0cce  TypeCheck + 0x16e in ..\src\misc\Scope.m3
 0x12f5c4   0x4c159b  TypeCheck + 0x305 in ..\src\values\Module.m3
.........  .........  ... more frames ...
 
 
1) The test is in error, wrong type on one of the params.
2) This could be specific to using m3back.
3) I'll poke around more.
4) Too bad we don't get line numbers in the stacks.
 
 - Jay
 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100211/49add56c/attachment-0002.html>


More information about the M3devel mailing list