2024-10-11 19:35 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000369mercuryBugpublic2014-12-16 10:18
Reportersebgod 
Assigned Tozs 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
PlatformWindows NT 6.3 x86_64OSWindowsOS Version8.1
Product Version 
Target VersionFixed in Version 
Summary0000369: Software Error: hlds.pred_table: predicate `hlds.pred_table.lookup_builtin_pred_proc_id'/8: Unexpected: can't locate put/5
DescriptionUsing the latest Mercury compiler (git commit fd822d712a8f1170a9fab3d9a1d05dd5e404106b)
Compiling the attached example module yields following exception:
Making Mercury\int3s\stream_put5_bug.int3
Making Mercury\ints\stream_put5_bug.int
Making Mercury\asm_fast.gc\i686-pc-mingw32\Mercury\cs\stream_put5_bug.c
Uncaught Mercury exception:
Software Error: hlds.pred_table: predicate `hlds.pred_table.lookup_builtin_pred_proc_id'/8: Unexpected: can't locate stream.put/5
Stack dump not available in this grade.
Error: system command received signal 1.
** Error making `Mercury\asm_fast.gc\i686-pc-mingw32\Mercury\cs\stream_put5_bug.c'.
Steps To Reproducemmc -m stream_put5_bug
Additional InformationUnfortunately I'm not sure when this bug exactly appeared (the program I used to compile was working fine for a while).
An educated guess is that this appeared after the string.format changes in the compiler.
TagsNo tags attached.
Attached Files
  • ? file icon stream_put5_bug.m (352 bytes) 2014-12-16 03:17
  • diff file icon pred_table_fix_lookup_builtin_pred_proc_id.diff (1,552 bytes) 2014-12-16 03:18 -
    diff --git a/compiler/pred_table.m b/compiler/pred_table.m
    index b9d35d4..4ddf788 100644
    --- a/compiler/pred_table.m
    +++ b/compiler/pred_table.m
    @@ -1224,9 +1224,9 @@ lookup_builtin_pred_proc_id(Module, ModuleName, ProcName, PredOrFunc,
         ->
             PredId = PredIdPrime
         ;
    -        string.int_to_string(Arity, ArityStr),
             unexpected($module, $pred,
    -            "can't locate " ++ ProcName ++ "/" ++ ArityStr)
    +            string.format("can't locate %s.%s/%d",
    +                [s(ModuleName), s(ProcName), i(Arity)]))
         ),
         module_info_pred_info(Module, PredId, PredInfo),
         ProcIds = pred_info_procids(PredInfo),
    @@ -1236,8 +1236,8 @@ lookup_builtin_pred_proc_id(Module, ModuleName, ProcName, PredOrFunc,
                 ProcId = ProcId0
             ;
                 unexpected($module, $pred,
    -                string.format("expected single mode for %s/%d",
    -                    [s(ProcName), i(Arity)]))
    +                string.format("expected single mode for %s.%s/%d",
    +                    [s(ModuleName), s(ProcName), i(Arity)]))
             )
         ;
             ModeNo = mode_no(N),
    @@ -1245,8 +1245,8 @@ lookup_builtin_pred_proc_id(Module, ModuleName, ProcName, PredOrFunc,
                 ProcId = ProcId0
             ;
                 unexpected($module, $pred,
    -                string.format("there is no mode %d for %s/%d",
    -                    [i(N), s(ProcName), i(Arity)]))
    +                string.format("there is no mode %d for %s.%s/%d",
    +                    [i(N), s(ModuleName), s(ProcName), i(Arity)]))
             )
         ).
     
    
    diff file icon pred_table_fix_lookup_builtin_pred_proc_id.diff (1,552 bytes) 2014-12-16 03:18 +

-Relationships
+Relationships

-Notes

~0000799

sebgod (reporter)

Last edited: 2014-12-16 03:21

View 2 revisions

To pinpoint the bug, I've modified the hlds.pred_table.lookup_builtin_pred_proc_id/8 procedure (see attached diff) to also output the module name in the error message, not sure if that is generally useful.
Just thought that put/5 was a little bit too generic.

~0000800

zs (developer)

Fix add253af9fa0d396034004bef2e36a4512eb8b1a committed 2014 dec 16.
+Notes

-Issue History
Date Modified Username Field Change
2014-12-16 03:17 sebgod New Issue
2014-12-16 03:17 sebgod File Added: stream_put5_bug.m
2014-12-16 03:18 sebgod File Added: pred_table_fix_lookup_builtin_pred_proc_id.diff
2014-12-16 03:20 sebgod Note Added: 0000799
2014-12-16 03:21 sebgod Note Edited: 0000799 View Revisions
2014-12-16 05:28 zs Assigned To => zs
2014-12-16 05:28 zs Status new => assigned
2014-12-16 10:18 zs Note Added: 0000800
2014-12-16 10:18 zs Status assigned => resolved
2014-12-16 10:18 zs Resolution open => fixed
+Issue History