On Thu, Jan 28, 2010 at 12:57:23PM +0100, Jürgen Spitzmüller wrote:
> Jürgen Spitzmüller wrote:
> > Actually, we talked about different crashes. Yours is still there :-(
> 
> It was a missing updateLabels() call in mathed. The attach addition fixes the 
> problem for me. Please test.

Unfortunately the crash still occurs for me. If I cut and paste a ref
inset into a \text inset and then modify the referenced label, I get
the following backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00000004 in ?? ()
(gdb) bt
#0  0x00000004 in ?? ()
#1  0x082bc418 in lyx::InsetMathHull::label (this=0x9733eb0, row=0, label=...)
    at ../../src/mathed/InsetMathHull.cpp:544
#2  0x082c3358 in lyx::InsetMathHull::doDispatch (this=0x9733eb0, cur=..., 
    cmd=...) at ../../src/mathed/InsetMathHull.cpp:1331
#3  0x0835ee81 in lyx::Inset::dispatch (this=0x9733eb0, cur=..., cmd=...)
    at ../../src/insets/Inset.cpp:293


Instead, if I insert a new ref inset through the dialog (not even in a
\text inset) and then modify the label, I get the following:

Program received signal SIGSEGV, Segmentation fault.
0x083cd981 in lyx::InsetLabel::updateCommand (this=0x979bf48, new_label=..., 
    updaterefs=true) at ../../src/insets/InsetLabel.cpp:88
88                              if (it->first->lyxCode() == MATH_REF_CODE) {


Note that lines 543 and 544 in InsetMathHull.cpp are:

                        if (buffer_)
                                label_[row]->updateCommand(label);

So, it is not due to an empty buffer_ member and, curiously, while the
first crash occurs while trying to call InsetLabel::updateCommand, the
second one occurs right in InsetLabel::updateCommand.
Also note that in both cases label_[row] and it->first are not NULL,
so the crashes are not due to dereferencing a NULL pointer.
This is puzzling. It seems that label_[row] and it->first point to
random locations.

-- 
Enrico

Reply via email to