View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0000278 | mercury | Bug | public | 2013-04-04 23:16 | 2015-10-29 14:47 | ||||
Reporter | pbone | ||||||||
Assigned To | zs | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Platform | x86_64 | OS | Debian Linux | OS Version | 7.0 | ||||
Product Version | |||||||||
Target Version | 15.11 | Fixed in Version | |||||||
Summary | 0000278: Compiler crash from bad state variable use. | ||||||||
Description | If I refer to the wrong state variable in the head of a lambda expression, I can reliably crash the compiler. I have a test case. | ||||||||
Steps To Reproduce | Attached in the testcase It crashes when I compile it with 'mmc --make' It also crashes in the Java grade. mmc -V prints out the following just before the crash. % Converting parse tree to hlds... % Processing clause 1 for predicate `bug.main/2'... % Processing clause 1 for predicate `bug.build_map/5'... The exception thrown is: Uncaught Mercury exception: Software Error: hlds.make_hlds.state_var: predicate `hlds.make_hlds.state_var.svar_find_final_renames_and_copy_goals'/7: Unexpected: readonly status Stack dump not available in this grade. ** Error making `Mercury/cs/bug.c'. I'm using the 12.08 beta (The release MCit is using) | ||||||||
Tags | No tags attached. | ||||||||
Attached Files |
|
Notes | |
juliensf (administrator) 2013-04-10 16:06 |
In principle this is easy to fix, just replace the relevant call to unexpected/2 in compiler/state_var.m with something that generates a proper error message. The issue is: what should that error message be? (Probably, before zs rewrote the state var transformation this would have been picked up later by mode checking ...) |
juliensf (administrator) 2013-04-10 16:07 |
It (hopefully) goes without saying, that this has nothing do with what backend is being used! |
juliensf (administrator) 2013-05-29 00:43 |
Actually, with Mercury 10.04.2, lots of phases picked up the error: bug278.m:023: In clause for predicate `build_map'/5: bug278.m:023: in argument 1 of call to predicate `list.foldl2'/6: bug278.m:023: type error: argument has type `pred(tree234.tree234(K, V), V, bug278.m:023: tree234.tree234(K, V), V_11, V_9)', bug278.m:023: expected type was `pred(L, A, A, Z, Z)'. bug278.m:023: In clause for predicate `bug278.build_map'/5: bug278.m:023: warning: variable `STATE_VARIABLE_MemoTable' occurs only once bug278.m:023: in this scope. bug278.m:028: In clause for predicate `build_map'/5: bug278.m:028: in argument 1 (i.e. the predicate term) of higher-order bug278.m:028: predicate call: bug278.m:028: type error: variable `KeyToValue' has type `(some [K, V] bug278.m:028: pred(K, V))', bug278.m:028: expected type was `pred(V_13, V_12, V_11, V_10)'. bug278.m:030: In clause for predicate `build_map'/5: bug278.m:030: in implicit state variable unification: bug278.m:030: type error in unification of variable `STATE_VARIABLE_M_1' bug278.m:030: and variable `STATE_VARIABLE_M_0'. bug278.m:030: `STATE_VARIABLE_M_1' has type `tree234.tree234(K, V)', bug278.m:030: `STATE_VARIABLE_M_0' has type `V'. The issue here is: what is an appropriate error message to generate during the state var transformation? |
zs (developer) 2015-10-22 06:49 |
fix committed 2015 oct 22. |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2013-04-04 23:16 | pbone | New Issue | |
2013-04-04 23:19 | pbone | File Added: bug278.m | |
2013-04-10 16:06 | juliensf | Note Added: 0000502 | |
2013-04-10 16:06 | juliensf | Assigned To | => juliensf |
2013-04-10 16:06 | juliensf | Status | new => confirmed |
2013-04-10 16:07 | juliensf | Note Added: 0000503 | |
2013-05-29 00:43 | juliensf | Note Added: 0000532 | |
2015-10-21 11:33 | zs | Assigned To | juliensf => zs |
2015-10-21 11:33 | zs | Status | confirmed => assigned |
2015-10-22 06:49 | zs | Note Added: 0000856 | |
2015-10-22 06:49 | zs | Status | assigned => resolved |
2015-10-22 06:49 | zs | Resolution | open => fixed |
2015-10-29 14:47 | pbone | Target Version | => 15.11 |