[mercury-users] Printing reference's values
Maria Garcia de la Banda
mbanda at mail.csse.monash.edu.au
Thu Dec 5 13:54:21 AEDT 2002
Hi,
I am trying to debug a program which uses references from the
extras/reference.m library. At some point the value of the reference is
obtained (using the reference:value(Ref,Value) predicate) and printed out
using io:write(Value,State,NState). Value is an abstract data structure
created using lib/map.m (thus a tree234(K,V) tree). The problem is that
io:write/3 seems to affect Value in such a way that any subsequent
operation on Value which traverses the tree bombs out. In particular if I
perform two such writes one after another the second one bombs out. The
messages are either a segmentation violation; a "Mercury runtime:
MR_expand_functor_only: attempt to deconstruct variable", or a
"MR_expand_functor_args: invalid sectag_locn", depending on what one
executes afterwards. Since the write operation is capable of printing the
entire tree sometimes and some others it bombs out after printing part of
the tree, I guess the tree is being corrupted at some point.
WHat am I missing? Any ideas? Thanks!
Maria
P.S. The program that causes this is part of the HAL compiler (which I am
trying to boostrap) and thus involves many different modules. I have
failed to obtain a small version of the program which still shows the
bug. If no one has any quick ideas about what the problem might be, I
will try again and send it to the mercury-bugs list.
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list