On Don, 04 Feb 1999 Bob McElrath wrote:
>On Wed, 3 Feb 1999, Alejandro Aguilar Sierra wrote:
>
>> On Wed, 3 Feb 1999, Bob McElrath wrote:
>>
>> > Hmmm...likely an alpha-specific problem then. I'm using egcs 1.1.1 on an
>> > alpha LX164, 533MHz (compiled lyx myself...not from RPM or deb). Know of
>> > anywhere in your math code <off the top of your head> that you assume
>> > sizeof(long) == sizeof(int) == sizeof(void*)? Because it isn't on
>> > alpha...longs and pointers are 64 bit.
>>
>> The problem is after retriving an inset from the array:
>>
>> MathedInset* px = GetInset();
>>
>> In GetInset we do:
>>
>> MathedInset* p;
>> memcpy(&p, &array->bf[pos+1], sizeof(p));
>>
>> and in the function to insert insets we do (same type of p) :
>>
>> memcpy(&array->bf[pos+1], &p, sizeof(p));
>>
>> so it's consistent, hmm.. have you used LyX in your platform without these
>> problems before?
>
>Yes. 0.12 works fine. All of the pre-releases after that have problems,
>but I've never investigated...waiting for 1.0. :)
>
>I've played with gdb and lyx for a while, and have narrowed it down to the
>"MathedXIter *cursor" member variable of the MathedCursor class. This
>pointer isn't initialized properly. The reason it crashes is that
>cursor->Next() gets called when this=0x2 (cursor=0x2, that is). cursor is
>non-NULL, but still invalid, causing a seg fault when the Width() method
>attempts to access data at that address.
>
>I inserted initialization (to null) in the MathedCursor::MathedCursor
>constructor, and created a default constructor for MathedCursor (that never
>got called...but you guys probably know that) just in case. Neither of
>these fixed the problem. I can't find who is clobbering or improperly
>initializing the cursor pointer since *so* many functions use it...
>
>I think it just happens to work on Intel, probably due to a fortuitous
>memory alignment where "cursor" starts out as NULL.
>
>It's interesting to note that I can type (including using bold) normally in
>math mode. But any attempt to insert a new piece of math kills it. I can
>type '\', but the first character that follows crashes it. HOWEVER, when I
>break on calls to MathedXIter::Next, I see the following behaviour:
>
>>>>>>>>>> I type 'a'
>Breakpoint 2, MathedXIter::Next (this=0x2) at math_iter.C:575
>575 {
>Current language: auto; currently c++
>(gdb) c
>Continuing.
Very similar to what I remember seeing in LyX.
But for me it does work when compiled without optimization :-?
Greetings,
Jochen
-----------------------------------------------------------------------
Jochen K"upper
Heinrich-Heine-Universit"at D"usseldorf [EMAIL PROTECTED]
Institut f"ur Physikalische Chemie I
Universit"atsstr. 1, Geb 26.43 Raum 02.29 phone ++49-211-8113681
40225 D"usseldorf fax ++49-211-8115195
Germany http://www-public.rz.uni-duesseldorf.de/~jochen
-----------------------------------------------------------------------