On Thu, 11 Mar 1999, Volker Enderlein wrote:
> On Mar 11, 3:40pm, Allan Rae wrote:
> > The line in question is probably:
> >
> > background_color = b_c; // lyx_gui.C:191
> >
> > Both background_color (an LString) and b_c (a char[32]) are declared
> > earlier at file scope (lines 123 and 124 respectively).
> >
> > b_c is set by xforms in the fl_get_app_resources() call (line 181).
[...]
> > If background_color hasn't been constructed yet then we could certainly
> > see this kind of crash although it would probably occur in the inlined
> > lose() call from within operator=(char const *). Which wouldn't be seen
> > on the stack trace unless debugging info was available.
[...]
> Think you're right. Just found the time to install GNU 2.8.1 with debug
> support. As linked with GNU CC 2.7.2, the same effect occurs. But now I'm able
> to provide you with a backtrace. Don't be confused about the irix version. I
> build the compiler on my host for mips-sgi-irix5.3 and uses the operating
> system's linker not the GNU ld.
>
> gdb --se=lyx1.0.0sgi
[...]
> Program received signal SIGSEGV, Segmentation fault.
> 0x61b900 in LString::operator= (this=0x10058ee0, s=0x10059288 "linen") at
> LString.C:93
> 93 static srep empty_rep;
> (gdb) bt
> #0 0x61b900 in LString::operator= (this=0x10058ee0, s=0x10059288 "linen") at
> LString.C:93
> #1 0x454b70 in LyXGUI::LyXGUI (this=0x100c55d0, owner=0x10059288,
> argc=0x7fff2f20, argv=0x7fff2f44, GUI=void)
> at lyx_gui.C:186
Hmmm... I take it you get the same result with LyX-1.0.1?
There were a couple of lines changed at this point in lyx_gui.C between
the two versions. They shouldn't affect this crash though.
I've done a bit of testing and on my machine the cvs version of LyX has
called LString::operator=(char const *) 61 times when it gets to this
point. Could you do a little bit of testing for me?
Read all the following before attempting it -- so it makes sense to you.
These are handholding instructions so I apologise if you know what you're
doing with gdb.
With lyx-1.0.1 (or preferrably cvs version: lyx-1_0_x) do the following:
Start gdb with:
gdb ./lyx
then:
br LString::operator=(char const *)
ignore 1 60
this will help us know how many times it was called but will save you from
typing "continue" until we get to the interesting stuff.
br 'LyXGUI::LyXGUI<Tab>
that is press the tab key to fill in the rest and press enter. If it
doesn't work then use:
br LyXGUI::LyXGUI(LyX *, int *, char **, bool)
now
run
LyX should stop at breakpoint 2 (the one in LyXGUI) if it stops at
breakpoint 1 then my ignore count wasn't big enough so just enter:
c
until we get to breakpoint 2.
Now that we're at breakpoint 2 there's a couple of things we test:
print background_color
you should see something like:
$1 = {p = 0x817d844}
Please include in your reply the output of all the different "print ..."
that I ask for, thanks.
Now we need to get to the call we're interested in so press
n
until the line:
background_color = b_c;
appears.
print *background_color.p
print b_c
now press:
s
to step into the operator=() call. Collect the following info:
info locals
print *this.p
info br
with luck it won't have crashed already.
The current line should be:
lose(); // disconnect self
if it is in fact:
static srep empty_rep;
then we may indeed have a problem. Now just single step till it dies
s
If you did see the empty_rep line then it should have entered the
srep::srep() constructor but it still shouldn't crash if that were the
case.
This probably will only prove that gcc is busted on your system.
Does the binary that Amir(?) made for Irix work for you?
Amir(?) what did you use to compile the Irix binary?
Thanks,
Allan. (ARRae)