Re: XForms: Crash when pasting empty string.

Jean-Marc Lasgouttes (Jean-Marc.Lasgouttes@inria.fr)
Thu, 3 Jun 1999 14:35:07 +0200 (MET DST)

# To subscribers of the xforms list from Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr> :

>>>>> "TC" == T C Zhao <tc_zhao@yahoo.com> writes:

TC> # To subscribers of the xforms list from "T.C. Zhao"
TC> <tc_zhao@yahoo.com> : Thanks for the message. With that, I was
TC> able to reproduce and fix the problem in my current
TC> source. Sometimes it's amazing how long it takes for bugs to be
TC> discovered.

TC> If the problem is iritating enough for the user, I can certainly
TC> repackage v0.88.1 for some platforms with this fix tucked in or
TC> alternatively send the source file (only one file) to whoever that
TC> needs it.

I do not think it is such a big problem, especially since xforms 0.89
should arrive soon (what are your timing estimations?) and the bug
occurs rarely (and LyX has a quite good emergency save mechanism :).

While I am at it, another potential bug: there have been some reports
from users where lyx crashes after deleting an inset (an object
inserted in LyX text) to which a form is associated. From what I
understand, the problem is the following (and I have to say that I
probably do not understand much):

- the LyX workarea uses a free object. When the Delete key is used, it
is passed to the handler which eventually calls the destructor of the
inset object. This destructor looks like:

InsetUrl::~InsetUrl()
{
if (form) {
fl_hide_form(form);
fl_free_form(form);
form = 0;
}
}

- Then, on some systems (not mine unfortunately), LyX crashes, with a
typical backtrace like:

$ gdb lyx -c core
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i486-slackware-linux),
Copyright 1996 Free Software Foundation, Inc...
Core was generated by `lyx'.
Program terminated with signal 6, IOT trap/Abort.
Reading symbols from /usr/X11R6/lib/libforms.so.0.88...done.
Reading symbols from /usr/X11R6/lib/libXpm.so.4...done.
Reading symbols from /usr/X11R6/lib/libSM.so.6...done.
Reading symbols from /usr/X11R6/lib/libICE.so.6...done.
Reading symbols from /lib/libc.so.5...done.
Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
Reading symbols from /usr/lib/libg++.so.27...done.
Reading symbols from /usr/lib/libstdc++.so.27...done.
Reading symbols from /lib/libm.so.5...done.
Reading symbols from /lib/ld-linux.so.1...done.
#0 0x4011ca89 in __kill ()
(gdb) bt
#0 0x4011ca89 in __kill ()
#1 0x400eb8c9 in gsignal ()
#2 0xbffff830 in ?? ()
#3 0x40034ee9 in fl_last_event ()
#4 0x40035582 in fl_treat_interaction_events ()
#5 0x400355c0 in fl_check_forms ()
#6 0x8053e32 in LyXGUI::runTime (this=0x81a7988) at lyx_gui.C:624
#7 0x804db75 in LyX::LyX (this=0xbffffaec, argc=0xbffffb10,
argv=0xbffffb2c)
at ../src/lyx_main.C:119
#8 0x804d7ec in main (argc=1, argv=0xbffffb2c) at ../src/main.C:51
#9 0x804d6ce in _start ()
(gdb) quit

Is it possible that, when a form is freed, it is not removed from some
linked list used by fl_check_forms and that this non-existant form is
triggered anyway?

Related question: what is a good place to delete forms?

JMarc
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/