Mercury Bugs - mercury
View Issue Details
0000309mercuryBugpublic2014-01-20 15:182014-01-28 15:09
Reporterpbone 
Assigned Topbone 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
Platformx86-64OSLinux (Debian)OS Version7.x
Product Version 
Target VersionFixed in Version 
Summary0000309: Compiler crashes during LLDS to C "stack var out or range"
DescriptionSoftware Error: ll_backend.llds_out.llds_out_data: predicate `ll_backend.llds_out.llds_out_data.output_lval'/4: Unexpected: stack var out of range

May be related to bug 0000098
Steps To Reproduce$ uname -a
Linux acer 3.2.0-4-amd64 0000001 SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux

$ mmc --version
Mercury Compiler, version 13.05.2, configured for x86_64-unknown-linux-gnu
Copyright (C) 1993-2013 The University of Melbourne
[edit: I've verified that this is reporducable with the current version-14.01 branch, 36469c59751bfea07c453dd2d557a323835c0b63)

[edit: see attached file]
$ mmc stack_var_out_of_range.m -E
Uncaught Mercury exception:
Software Error: ll_backend.llds_out.llds_out_data: predicate `ll_backend.llds_out.llds_out_data.output_lval'/4: Unexpected: stack var out of range
Stack dump not available in this grade.

Checked other optimization options. Summary:
[edit: I (Paul) haven't yet conformed these details below. However I can conform that this is reproducible with -O0 and --no-llds-optimize.)

Doesn't work:
    -O0 through -O6
    --opt-space, --optimize-space
    --no-read-opt-files-transitively
    --intermodule-analysis

Works:
    --intermod-opt
    --trans-intermod-opt

Not checked:
    --analysis-repeat <n>

Additional InformationInitially reported via IRC by like-a-boss on #mercury on freenode.net.
TagsNo tags attached.
related to 0000098new  compiler throws exception with --profile-for-implicit-parallelism 
Attached Files? stack_var_out_of_range.m (1,280) 2014-01-21 01:18
https://bugs.mercurylang.org/file_download.php?file_id=188&type=bug
? environment.m (988) 2014-01-21 09:42
https://bugs.mercurylang.org/file_download.php?file_id=189&type=bug

Notes
(0000607)
pbone   
2014-01-21 09:43   
like-a-boss has found a second test case, environment.m
(0000608)
pbone   
2014-01-22 12:12   
Waiting for feedback from the other Mercury developers about different solutions:

http://lists.mercurylang.org/pipermail/developers/2014-January/015987.html
(0000621)
pbone   
2014-01-28 15:09   
Fixed in dde8f920eb9583e447c0f7425efb9c72a8e9aa72 on the release branch.

Issue History
2014-01-20 15:18pboneNew Issue
2014-01-20 15:18pboneFile Added: erlang_rtti_implementation.m
2014-01-21 01:18pboneFile Deleted: erlang_rtti_implementation.m
2014-01-21 01:18pboneFile Added: stack_var_out_of_range.m
2014-01-21 09:42pboneRelationship addedrelated to 0000098
2014-01-21 09:42pboneFile Added: environment.m
2014-01-21 09:43pboneNote Added: 0000607
2014-01-21 15:11pboneAssigned To => pbone
2014-01-21 15:11pboneStatusnew => assigned
2014-01-22 12:12pboneNote Added: 0000608
2014-01-28 15:09pboneNote Added: 0000621
2014-01-28 15:09pboneStatusassigned => closed
2014-01-28 15:09pboneResolutionopen => fixed