2024-11-22 03:56 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000426mercuryBugpublic2018-08-09 22:05
Reporterjuliensf 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000426: Tabling broken on 32-bit Cygwin
DescriptionPretty much every tabling test case and the compiler itself (the CTGC code uses pragma memo)
abort with an error about having detected infinite recursion. In the tabling transformation, det procedures are transformed as follows:

    p(A, B) :-
       TO = <table pointer for p/2>,
       impure table_lookup_insert(T0, A, T),
       impure table_loop_setup(T, Status),
       (
           Status = loop_active,
           error("detected infinite recursion in ...")
      ;
           Status = loop_inactive,
           ...
      )

On Cygwin the variable Status gets set to a rubbish value at some points. It actually ends up matching the default case of the C switch we generate for the above Mercury switch but then falls through to the infinite recursion case. (Enabling assertions would cause it to abort.) I haven't tracked down why this is occurring although it may have something to do with the fact that on Windows sizeof(int) == sizeof(long). (Is the tabling code making assumption that sizeof(long) > sizeof(int) somewhere?)




     

TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0001006

wangp (developer)

Probably the same issue with the fast_loose.m test case on 32-bit Linux, but strangely it's only reproducible in .par grades (at least hlc.par.gc and reg.par.gc).

I've attached a debug log with MR_TABLE_DEBUG and MERCURY_OPTIONS=-dT enabled if it would help. The last lines show:

TABLE 0x804f498: gen f036a279 type 0x804edf8 => 0xf0149508
status of memo table 0xf0149508: -262636112 (f0587db0)

where f0587db0 is an address seen earlier:

allocated answer block 0xf0149508 -> 0xf0587db0, 1 words
saving to answer block: 0xf0587db0, slot 0 = 6351
+Notes

-Issue History
Date Modified Username Field Change
2016-10-21 15:47 juliensf New Issue
2018-08-09 22:05 wangp File Added: fast_loose.txt.gz
2018-08-09 22:05 wangp Note Added: 0001006
+Issue History