Mercury Bugs - mercury
View Issue Details
0000098mercuryBugpublic2009-06-12 14:562014-01-28 15:55
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000098: compiler throws exception with --profile-for-implicit-parallelism
Descriptionrotd-2009-06-09 aborts with an exception when compiling the standard library module
erlang_rtti_implementation.m in grade asm_fast.gc.profdeep with --profile-for-implicit-parallelism

Uncaught Mercury exception:
Software Error: llds_out.m: Unexpected: stack var out of range
Stack dump not available in this grade.

Compiling with --no-inline-simple acts a workaround.
TagsNo tags attached.
related to 0000309closed pbone Compiler crashes during LLDS to C "stack var out or range" 
Attached Files? erlang_rtti_implementation.m (8,995) 2009-06-15 01:32

2009-06-12 16:26   
--profile-for-implicit-parallelism enables inlineing which is normally disabled in deep profiling builds. This makes the resulting profile look more like the profile that would be generated by a non-profiling build.

I believe that this bug might be able to be triggered by enabling inlineing in a deep profiling build without enabling --profile-for-implicit-parallelism.
2009-06-12 16:49   
Yes, you're right. Compiling without --profile-for-implicit-paralellism but with --profile-optimized
enabled also triggers the bug.
2009-06-15 01:34   
(Last edited: 2009-06-15 01:36)
I've uploaded a cut-down version of erlang_rtti_implemetation that exhibits this bug.
(Curiosly, the problem goes away if I rename the module, although I can't see anywhere
in the compiler that treats the module erlang_rtti_implementation specially in C grades;
the bug is also not present if we rename the module to another stdlib or builtin module.)

The test case is derived from r1.89 of library/erlang_rtti_implementation.m.

2014-01-22 15:26   
The compiler DOES treat standard library modules specially in some places. It does list them by name; it uses mercury_std_library_module/1 in library/library.m.
2014-01-28 15:55   
I cannot reproduce this bug (on a compiler without the 0000309 fix) using the attached file. Perhaps changes have been made to the compiler such that the bug (whatever it was) is no longer being triggered.

I also can't reproduce this by building Mercury with these options. Unless someone knows how to reproduce this, I propose we close this bug.


Issue History
2009-06-12 14:56juliensfNew Issue
2009-06-12 16:26pboneNote Added: 0000172
2009-06-12 16:49juliensfNote Added: 0000173
2009-06-15 01:32juliensfFile Added: erlang_rtti_implementation.m
2009-06-15 01:34juliensfNote Added: 0000175
2009-06-15 01:36juliensfNote Edited: 0000175
2014-01-21 09:42pboneRelationship addedrelated to 0000309
2014-01-22 15:26zsNote Added: 0000609
2014-01-28 15:55pboneNote Added: 0000622