Mercury Bugs - mercury
View Issue Details
0000369mercuryBugpublic2014-12-16 03:172014-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? stream_put5_bug.m (352) 2014-12-16 03:17
https://bugs.mercurylang.org/file_download.php?file_id=230&type=bug
diff pred_table_fix_lookup_builtin_pred_proc_id.diff (1,552) 2014-12-16 03:18
https://bugs.mercurylang.org/file_download.php?file_id=231&type=bug

Notes
(0000799)
sebgod   
2014-12-16 03:20   
(Last edited: 2014-12-16 03:21)
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   
2014-12-16 10:18   
Fix add253af9fa0d396034004bef2e36a4512eb8b1a committed 2014 dec 16.

Issue History
2014-12-16 03:17sebgodNew Issue
2014-12-16 03:17sebgodFile Added: stream_put5_bug.m
2014-12-16 03:18sebgodFile Added: pred_table_fix_lookup_builtin_pred_proc_id.diff
2014-12-16 03:20sebgodNote Added: 0000799
2014-12-16 03:21sebgodNote Edited: 0000799bug_revision_view_page.php?bugnote_id=799#r36
2014-12-16 05:28zsAssigned To => zs
2014-12-16 05:28zsStatusnew => assigned
2014-12-16 10:18zsNote Added: 0000800
2014-12-16 10:18zsStatusassigned => resolved
2014-12-16 10:18zsResolutionopen => fixed