2024-11-07 15:15 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000091mercuryBugpublic2016-07-01 10:11
Reportermaclarty 
Assigned Tojuliensf 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
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.
Attached Files

-Relationships
duplicate of 0000017resolvedzs no error for unknown types in interface if defined in implementation 
+Relationships

-Notes

~0000161

maclarty (developer)

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 (developer)

Of course this doesn't explain why the original program compiles in asm_fast.gc.

~0000891

juliensf (administrator)

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.
+Notes

-Issue History
Date Modified Username Field Change
2009-03-09 22:32 maclarty New Issue
2009-03-09 22:32 maclarty File Added: bug.tar.gz
2009-03-11 17:59 maclarty Note Added: 0000161
2009-03-11 18:01 maclarty File Added: bug2.m
2009-03-11 18:02 maclarty Note Added: 0000162
2015-10-31 20:42 juliensf Relationship added duplicate of 0000017
2016-07-01 10:11 juliensf Note Added: 0000891
2016-07-01 10:11 juliensf Status new => resolved
2016-07-01 10:11 juliensf Resolution open => fixed
2016-07-01 10:11 juliensf Assigned To => juliensf
+Issue History