View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0000426 | mercury | Bug | public | 2016-10-21 15:47 | 2018-08-09 22:05 | ||||||||
Reporter | juliensf | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||||||
Status | new | Resolution | open | ||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000426: Tabling broken on 32-bit Cygwin | ||||||||||||
Description | Pretty 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?) | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files |
|
Notes | |
wangp (developer) 2018-08-09 22:05 |
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 |