Mercury Bugs - mercury
View Issue Details
0000074mercuryBugpublic2008-08-07 02:322008-09-02 04:42
Reporterobo 
Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000074: abstract data types in type classes get garbled on x64
DescriptionThe attached code is a reduced version of bug 0000073 (please close bug 0000073).

What happens is that the method recombine/1 of typeclass stackable/3 instantiated by the predicate myrecombine/1 gets called with a bad type information on 64-bit machines (rotd-2008-08-03):

18:15 tauri4 nano-nano$./bug_x64_typeclass
insprune calls recombine: bug_x64_typeclass.h(string, string)
Recombining: bug_x64_typeclass.h(bug_x64_typeclass.h(string, string), bug_x64_typeclass.h(string, string))
Uncaught Mercury exception:
Software Error: type screwed up

On 32-bit machines (rotd-2007-08-13, I don't have a fresher version, sorry), the code works.
TagsNo tags attached.
Attached Files? bug_x64_typeclass.m (1,940) 2008-08-07 02:32
https://bugs.mercurylang.org/file_download.php?file_id=61&type=bug

Notes
(0000117)
juliensf   
2008-08-07 15:27   
The same also occurs on 32-bit machines with rotd-2008-08-06.
(0000144)
juliensf   
2008-09-02 04:41   
The problem here is that the current Mercury RTTI implementation does not supported
"complicated" typeclass constraints like the following:

:- pred myrecombine(h(OCC, OC)::in) is semidet <= (stackable(h(OCC, OC), float, string)).

Currently, the parameters of typeclass constraints can only be type variables or types
with no arguments. Anything else, like h(OCC, OC), (probably) won't work.

Issue History
2008-08-07 02:32oboNew Issue
2008-08-07 02:32oboFile Added: bug_x64_typeclass.m
2008-08-07 15:27juliensfNote Added: 0000117
2008-08-07 15:27juliensfStatusnew => acknowledged
2008-09-02 04:41juliensfNote Added: 0000144
2008-09-02 04:42juliensfStatusacknowledged => confirmed