Mercury Bugs - mercury
View Issue Details
0000091mercuryBugpublic2009-03-09 22:322016-07-01 10:11
Reportermaclarty 
Assigned Tojuliensf 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000091: compiler throws exception in hlc.gc
Description$ tar -xzf bug.tar.gz
$ mmc --version
Mercury Compiler, version rotd-2009-03-08, configured for x86_64-unknown-linux-gnu
Copyright (C) 1993-2009 The University of Melbourne
$ mmc --grade hlc.gc run.m
Uncaught Mercury exception:
Software Error: map.lookup: key not found
    Key Type: parse_tree.prog_data.type_ctor
    Key Value: type_ctor(qualified(unqualified("interpreter"), "value"), 0)
    Value Type: hlds.hlds_data.hlds_type_defn
Stack dump not available in this grade.

Error still occurs with -O-1.
TagsNo tags attached.
duplicate of 0000017resolved zs no error for unknown types in interface if defined in implementation 
Attached Filesgz bug.tar.gz (1,657) 2009-03-09 22:32
https://bugs.mercurylang.org/file_download.php?file_id=70&type=bug
? bug2.m (97) 2009-03-11 18:01
https://bugs.mercurylang.org/file_download.php?file_id=72&type=bug

Notes
(0000161)
maclarty   
2009-03-11 17:59   
The problem here seems to be that the type interpreter.value/0 is not exported to interpreter.int. It is not exported, because it is only defined in the implementation. It is however used in the interface as the argument of another type's functor. One would expect this to cause an error when compiling interpreter.m.

I've attached a simpler test case that triggers this bug. In bug2.m type a uses type b in the interface, but type b is only defined in the implementation. This module compiles without error (mmc -C bug2.m).
(0000162)
maclarty   
2009-03-11 18:02   
Of course this doesn't explain why the original program compiles in asm_fast.gc.
(0000891)
juliensf   
2016-07-01 10:11   
The fix for 0000017 also resolves this one. The larger of the two test cases still causes an abort in the compiler
but that's only because the supplied .int files are invalid -- newer versions of the compiler won't allow them to be generated in the first place.

Issue History
2009-03-09 22:32maclartyNew Issue
2009-03-09 22:32maclartyFile Added: bug.tar.gz
2009-03-11 17:59maclartyNote Added: 0000161
2009-03-11 18:01maclartyFile Added: bug2.m
2009-03-11 18:02maclartyNote Added: 0000162
2015-10-31 20:42juliensfRelationship addedduplicate of 0000017
2016-07-01 10:11juliensfNote Added: 0000891
2016-07-01 10:11juliensfStatusnew => resolved
2016-07-01 10:11juliensfResolutionopen => fixed
2016-07-01 10:11juliensfAssigned To => juliensf