Am Mittwoch, 25. Oktober 2017 um 15:24:33, schrieb Richard Heck <rgh...@lyx.org> > On 10/25/2017 02:35 PM, Kornel Benko wrote: > > Am Dienstag, 24. Oktober 2017 um 19:51:41, schrieb Jean-Marc Lasgouttes > > <lasgout...@lyx.org> > >> Le 23/10/2017 à 22:26, Pavel Sanda a écrit : > >>> And I have reproducible crash: > >>> 1. start new document > >>> 2. write "ambititious ", spellcheck correctly underlies text. > >>> 3. try to fix spelling via context menu, choose "ambitious" > >>> 4. kaboom > >> I can't reproduce. Qt4 or Qt5? > >> > >> JMarc > > I can reproduce with continuous spellcheck enabled. Qt5. > > > > It crashes on LASSERT(LASSERT(end > start && end <= size() + 1, return > > false); > > at src/Paragraph.cpp:612 > > (gdb) p start > > $1 = 0 > > (gdb) p end > > $2 = 11 > > (gdb) p size() > > $1 = 9 > > > > Without this assert, everything works OK. Richard, why is it there needed? > > "git blame" will blame me, but I only added the "return false". That > way, in release mode, we just say "no change" and continue, hopefully > safely. The assertion itself goes back to d53d4a5c, in 2006. > > Presumably, the end variable does not really make sense here. Position > 11 is past the end of the paragraph (and past the end of paragraph > marker at pos=10). We're lucky, because Changes::isChanged isn't > affected by this. Something is definitely wrong, though, and that's what > the assertion is telling us. > > Richard
The same assertion in 2.3.x does not trigger here. (gdb) p start $1 = 0 (gdb) p end $2 = 10 (gdb) p size() $3 = 9 ......................... (gdb) up #1 0x0000000000dfaae6 in lyx::RowPainter::paintChangeBar (this=0x7fffffffb290) at /usr2/src/lyx/lyx-2.0.x-git/src/RowPainter.cpp:259 259 if (start == end || !par_.isChanged(start, end)) (gdb) p end $4 = 10 (gdb) p par_.size() $5 = 9 In lyx2.4, it is totally impossible to debug. One has to wait for crash first. (gdb) up #6 0x0000000000dd94dc in lyx::Paragraph::isChanged (this=0x27ec370, start=0, end=11) at /usr2/src/lyx/lyx-git/src/Paragraph.cpp:612 612 LASSERT(end > start && end <= size() + 1, return false); (gdb) up #7 0x0000000000dfde10 in lyx::RowPainter::paintChangeBar (this=0x7fffffff5330) at /usr2/src/lyx/lyx-git/src/RowPainter.cpp:259 259 if (start == end || !par_.isChanged(start, end)) (gdb) p par_.size() $1 = 9 (gdb) p end $2 = 11 (gdb) p row_.endpos() $3 = 11 So the endpos() is different here. Kornel Kornel
signature.asc
Description: This is a digitally signed message part.