[mercury-users] Tcl/Tk

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Jun 7 15:39:48 AEST 2007

On Thu, 7 Jun 2007, Jörg Roman Rudnick wrote:

> Tomas By schrieb:
>> Hello all,
>> I am using the Mercury Tcl/Tk code from `extras' and am having a couple of
>> problems:
>> 1) Seg faults:
>> *** Mercury runtime: caught segmentation violation ***
>> PC at signal: 136059738 (81c1b5a)
>> address involved: 0xc
>> This may have been caused by a stack overflow, due to unbounded recursion.
>> exiting from signal handler
>> These seem to happen after a while when I am using the GUI. There is also
>> a largish data file (Prolog syntax) that cannot be read from the GUI
>> without causing a segmentation fault. Reading it before the widgets are
>> created works fine.
>> I tried increasing the "detstack" and "heap" with no effect. Any ideas how
>> I can start to try to debug this?
> I am just occupied with this issue -- I think I remember that this problem 
> occurred with the latest ROTD's, so that it might be a good idea to check out 
> the release (0.13.1).
> The problem might be deeper than mdb can reach; Peter Ross gave me a hint 
> about the Mercury low level debugger -- please see

The "Mercury low level debugger" is just gdb.

>> 2) Extra newlines
>> Whenever the "tk_popup" procedure is called a newline is printed in the
>> shell window. I seem to remember reading somewhere that this (or something
>> similar) was a known problem that had been solved, but I cannot find it
>> now.  Anybody hear a little bell ringing?
> Yep. Me. You mean a new line with a '%'? Then that's the prompt problem, for 
> which there is a fix at the download section of my Linux Magazine article,
> http://www.linux-magazine.com/Magazine/Downloads/78/Mercury
> Just take a look over the new mtcltk.m file -- and please try it with the 
> 0.13.1 release.
> BTW, I am astonished you did not stumble about an error message like
> mtk.m:523: Syntax error at token '--->': operator precedence error.
> mtk.m:582: In definition of predicate `mtk.bind'/7:
> mtk.m:582:   error: undefined type `event'/0.
> 'event' seems to have become a reserved word; changing the type's name 
> (thrice) to 'tk_event' or the like solves this problem.

Mercury does not (yet) have reserved words as such.  `event' is used
to specify event goals which are part of the recently added domain
specific debugging capabilities in the rotd.

The above error occurs because event is now an operator.  You could
avoid by placing parentheses around event, although a better long
term solution would be to do as you suggest and change the name.


More information about the users mailing list