Re: Anyone seen this menu problem?

From: Paul Anderson <paul_at_grammatech.com>
Date: Tue, 27 Apr 1999 12:36:22 -0400

An update:

> **** Fatal error in STk:
> **** ON est dans TclEvalObj
> **** ABORT.

I fixed the above by implementing Tcl_EvalObj, and was able to
make my menus appear properly.

However, I now have encountered another problem. Consider
the following example:

  (define l (label '.l :text "this will crash if you do Alt+A"))
  (pack l :side 'top)

  (define w.menu (menu '.menu :tearoff #f))

This crashes with a seg fault giving the following partial
stack trace:

(gdb) bt 5
#0 0x56cc8 in reenter_cont (eh=0x19c958) at cont.c:167
#1 0x56b90 in STk_throw (fct=0xefffde74, vals=0x19c948) at cont.c:136
#2 0x505b0 in STk_eval (x=0x19c958, env=0x19c948) at eval.c:468
#3 0x4e594 in eval_args (l=0x19c778, env=0x19c658) at eval.c:87
#4 0x505c4 in STk_eval (x=0x19c7a8, env=0x19c658) at eval.c:470
(More stack frames follow...)

This is caused by the call/cc in Tk:menu-find. The default binding
for the toplevel widget looks through all the menus to see if one
has an entry with an underlined character. It then checks to see if
that character matches the one just typed. This is what Tk:menu-find
is doing.

It turns out that it is very easy to crash using call/cc.
For example:

  (call/cc (lambda (exit) (exit 99)))

will seg fault in the same way.

I did manage to fix this too. In STk_throw in cont.c a variable
on the stack was being overwritten by the stack reset. The fix
was to use the static variable 'tmp' instead.

I am now up and running with my top level menus. I had to make
other fixes, but these were relatively minor and easy.

Erick: how would you like us to get you these changes?

Paul.

______
Paul Anderson. GrammaTech, Inc. http://www.grammatech.com
paul_at_grammatech.com Tel: +1 607 273-7340
Received on Tue Apr 27 1999 - 18:46:26 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST