pure virtual method called _and_ a segfault
===========================================

I clicked on a figure in a minipage in a float and the dialog popped
up and then I got an abort.  However seeing as how the initial mouse
click on the figure resulted in the cursor being placed in the middle
of the table below the figure (also in the same minipage but about 1.5
inches lower on screen) I had to click twice so it could be some
cursor placement problems that also assisted in triggering this abort.

The abort actually occurs during the toolbar update.  I did the same
operation a week ago and it worked fine then.

The actual structure looks something like this:
        Float:Figure
                Hfill
                Minipage
                        ERT
                        Figure
                        ERT
                        Tabular
                        ERT
                HFill
                Minipage
                        Figure
                Hfill
                Caption

The contents of the first minipage are all in the same paragraph.
The two minipages and associated HFills are all in the same paragraph.

If I understand where this backtrace is going then the claimed pure
virtual function must be called by the insettext in the minipage.
But why would it go bang?

Because InsetText::the_locking_inset is an InsetFig in this case?
Maybe, maybe not.  Another case after the backtrace.

src/insets/insettext.C:
1820 1.171  (jug      12-Jul-01): UpdatableInset * InsetText::getLockingInset() const
1821 1.171  (jug      12-Jul-01): {
1822 1.171  (jug      12-Jul-01):      return the_locking_inset ? 
the_locking_inset->getLockingInset() :
1823 1.171  (jug      12-Jul-01):              const_cast<InsetText *>(this);
1824 1.1    (jug      25-Feb-00): }


As gdb saw it:

pure virtual method called

Program received signal SIGABRT, Aborted.

(gdb) bt
#0  0x003702d1 in kill () from /lib/libc.so.6
#1  0x003700d5 in raise () from /lib/libc.so.6
#2  0x00371703 in abort () from /lib/libc.so.6
#3  0x002fbcdb in __default_terminate () from /usr/lib/libstdc++-libc6.2-2.so.3
#4  0x002fbcfc in __terminate () from /usr/lib/libstdc++-libc6.2-2.so.3
#5  0x081aa2a6 in __pure_virtual ()
#6  0x081368cb in InsetText::getLockingInset (this=0x839a2c0) at insettext.C:1823
#7  0x0813ae5f in InsetCollapsable::getLockingInset (this=0x839a268) at 
insetcollapsable.C:495
#8  0x081368cb in InsetText::getLockingInset (this=0x839ba10) at insettext.C:1823
#9  0x0812051c in InsetFloat::insetAllowed (this=0x839b9b8, code=ERT_CODE) at 
insetfloat.C:257
#10 0x080a98f3 in LyXFunc::getStatus (this=0x8276120, ac=221, 
not_to_use_arg=@0xbffff088)
    at lyxfunc.C:692
#11 0x080a8eee in LyXFunc::getStatus (this=0x8276120, ac=221) at lyxfunc.C:345
#12 0x08183659 in Toolbar::Pimpl::update (this=0x82a5d78) at Toolbar_pimpl.C:186
#13 0x0813ecd8 in Toolbar::update (this=0x82a5910) at Toolbar.C:74
#14 0x0806f366 in LyXView::showState (this=0x827e818) at LyXView.C:245
#15 0x08132e66 in InsetText::updateLocal (this=0x839a2c0, bv=0x82aa1a8, what=1, 
mark_dirty=false)
    at insettext.C:643
#16 0x08133aef in InsetText::insetButtonPress (this=0x839a2c0, bv=0x82aa1a8, x=189, 
y=-20, button=1)
    at insettext.C:904
#17 0x0813a9f4 in InsetCollapsable::insetButtonPress (this=0x839a268, bv=0x82aa1a8, 
x=189, y=-133,
    button=1) at insetcollapsable.C:320
#18 0x08133a40 in InsetText::insetButtonPress (this=0x839ba10, bv=0x82aa1a8, x=214, 
y=-133, button=1)
    at insettext.C:892
#19 0x0813a9f4 in InsetCollapsable::insetButtonPress (this=0x839b9b8, bv=0x82aa1a8, 
x=214, y=91,
    button=1) at insetcollapsable.C:320
#20 0x0805447e in BufferView::Pimpl::workAreaButtonPress (this=0x82aa308, xpos=214, 
ypos=91, button=1)
    at BufferView_pimpl.C:598
#21 0x081ac40b in SigC::ObjectSlot3_<void, int, int, unsigned int, 
BufferView::Pimpl>::callback (
    d=0x82ab6ac, p1=234, p2=72, p3=1) at ../sigc++/object_slot.h:347
#22 0x081b8fd5 in SigC::Signal3<void, int, int, unsigned int, SigC::Marshal<void> 
>::emit (
    this=0x82aa340, p1=@0xbffff42c, p2=@0xbffff428, p3=@0x1afa74) at 
../sigc++/slot.h:554
#23 0x08078493 in WorkArea::work_area_handler (ob=0x82ab298, event=2, key=1, 
xev=0x1afa40)
    at ../sigc++/basic_signal.h:589
#24 0x0807719f in C_WorkArea_work_area_handler (ob=0x82ab298, event=2, key=1, 
xev=0x1afa40)
    at WorkArea.C:65
#25 0x00172548 in fl_handle_it () from /usr/local/lib/libforms.so.0.88
#26 0x00172605 in fl_handle_object () from /usr/local/lib/libforms.so.0.88
#27 0x00164b71 in fl_handle_form () from /usr/local/lib/libforms.so.0.88
#28 0x00165b20 in do_interaction_step () from /usr/local/lib/libforms.so.0.88
#29 0x00165b49 in fl_treat_interaction_events () from /usr/local/lib/libforms.so.0.88
#30 0x00165b84 in fl_check_forms () from /usr/local/lib/libforms.so.0.88
#31 0x0814482d in GUIRunTime::runTime () at GUIRunTime.C:86
#32 0x080a2048 in LyXGUI::runTime (this=0x8265db8) at lyx_gui.C:315
#33 0x080a26d8 in LyX::LyX (this=0xbffff6f0, argc=0xbffff710, argv=0xbffff774) at 
../src/lyx_main.C:177
#34 0x080bb961 in main (argc=1, argv=0xbffff774) at ../src/main.C:38
#35 0x0035f1f0 in __libc_start_main () from /lib/libc.so.6
(gdb)


I did some experimenting and found that:
        Open new document
        insert->float->figure
        insert->minipage
        insert->old graphics
        insert->tabular material
        click on picture

is sufficient to cause this crash.
It does not occur until after you add the tabular though.

Ahhh I just spotted something interesting -- another case -- this time
a segfault.  This also crashes if you leave out the
"insert->figure->float" step but importantly the cursor has to have
been in a dummy position in the tabular when you click on the figure.

Strange that you get a sigabrt if its in a float and a segfault if
it's not.  Same bug different result, the offending line tries to use:
        the_locking_inset->toggleInsetCursor(bv);

Evidently, we are not updating the_locking_inset correctly somewhere.


Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x0813601e in InsetText::toggleInsetCursor (this=0x82ec528, bv=0x82aa1a8) at 
insettext.C:1636
#2  0x0813adf9 in InsetCollapsable::toggleInsetCursor (this=0x82ec4d0, bv=0x82aa1a8)
    at insetcollapsable.C:477
#3  0x08055501 in BufferView::Pimpl::cursorToggle (this=0x82aa308) at 
BufferView_pimpl.C:1087
#4  0x081ac3c2 in SigC::ObjectSlot0_<void, BufferView::Pimpl>::callback (d=0x82ab91c)
    at ../sigc++/object_slot.h:56
#5  0x081aa794 in SigC::Signal0<void, SigC::Marshal<void> >::emit (this=0x82aa324)
    at ../../../sigc++/slot.h:260
#6  0x0813eab3 in Timeout::emit (this=0x82aa324) at Timeout.C:60
#7  0x081832ce in C_intern_timeout_cb (data=0x82aa324) at Timeout_pimpl.C:31
#8  0x0018729e in fl_handle_timeouts () from /usr/local/lib/libforms.so.0.88
#9  0x0016643e in get_next_event () from /usr/local/lib/libforms.so.0.88
#10 0x001651fc in do_interaction_step () from /usr/local/lib/libforms.so.0.88
#11 0x00165b49 in fl_treat_interaction_events () from /usr/local/lib/libforms.so.0.88
#12 0x00165b84 in fl_check_forms () from /usr/local/lib/libforms.so.0.88
#13 0x0814482d in GUIRunTime::runTime () at GUIRunTime.C:86
#14 0x080a2048 in LyXGUI::runTime (this=0x8265db8) at lyx_gui.C:315
#15 0x080a26d8 in LyX::LyX (this=0xbffff6f0, argc=0xbffff710, argv=0xbffff774) at 
../src/lyx_main.C:177
#16 0x080bb961 in main (argc=1, argv=0xbffff774) at ../src/main.C:38
#17 0x0035f1f0 in __libc_start_main () from /lib/libc.so.6


Allan. (ARRae)



Reply via email to