Bug Hunting Session
Bug 68706 - assertion in SwUndo::SetSaveData when Record is on and Show is off
Summary: assertion in SwUndo::SetSaveData when Record is on and Show is off
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.5.2 release
Hardware: Other All
: medium critical
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-29 13:50 UTC by Timur
Modified: 2014-11-06 01:05 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Error message - crash on undo (19.45 KB, image/jpeg)
2013-08-29 13:50 UTC, Timur
Details
debug - crash on undo in document with track changes on (24.51 KB, text/plain)
2013-08-29 13:54 UTC, Timur
Details
Error message II - crash with track changes on and shown (29.12 KB, image/jpeg)
2013-08-30 12:33 UTC, Timur
Details
debug II - crash with track changes on and shown.txt (26.73 KB, text/plain)
2013-08-30 12:37 UTC, Timur
Details
console + bt with symbols on master sources (11.29 KB, text/plain)
2013-09-01 20:00 UTC, Julien Nabet
Details
typescript of gdb on the core file (9.58 KB, text/plain)
2014-03-13 17:48 UTC, Terrence Enger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2013-08-29 13:50:12 UTC
Created attachment 84841 [details]
Error message - crash on undo

I noticed a crash in Writer which is quite serious, I'd say critical. I get if as following:
- open new empty doc. in Writer 
- with Record changes and Show changes off, type "Some text " and keep cursor at the end
- turn Record on
- delete "text " with backspace, letter-by-letter
- press Undo
- there is a crash
I tested with libreoffice-4-0~2013-08-14_10.04.34_LibO-Dev_4.0.6.0_Win_x86 and libreoffice-4-1~2013-08-27_09.28.10_LibreOfficeDev_4.1.2.0.0_Win_x86.
Comment 1 Timur 2013-08-29 13:54:12 UTC
Created attachment 84842 [details]
debug - crash on undo in document with track changes on
Comment 2 Timur 2013-08-29 14:14:19 UTC
Looks to me that problem doesn't occur in 4.0.4.2 and 4.1.0.2 on Ubuntu, so it'd be recent just like bug https://bugs.freedesktop.org/show_bug.cgi?id=63214.
Comment 3 Timur 2013-08-30 12:33:43 UTC
Created attachment 84907 [details]
Error message II - crash with track changes on and shown
Comment 4 Timur 2013-08-30 12:37:58 UTC
Created attachment 84908 [details]
debug II - crash with track changes on and shown.txt

I had another bug, which looks quite different by the error message. It happened in a document with track changes on and shown. 
I still add it here for now. This all may or may not be related to also recent Bug 68046 or Bug 63214.
Comment 5 Timur 2013-08-30 17:30:11 UTC
Ma conclusion would be: first crash error happens on undo in Writer when Record is on and Show is off and second happens when Record is on and Show is on.
I get the second as following:
- open new empty doc. in Writer 
- with Record changes and Show changes on, type "line 1" in the first line and "line 2" in the second line
- delete paragraph with backspace, so that it remains "line1line2"
- press Undo
- there is a crash

I added Mr. Julien Nabet to CC.
How should a version be marked when it's current Dev branch?
Comment 6 Timur 2013-08-30 17:33:13 UTC
Problem doesn't occur in 4.0.5.2 and 4.1.1.2 in Windows.
Comment 7 Julien Nabet 2013-09-01 18:26:37 UTC
Comment on attachment 84841 [details]
Error message - crash on undo

Mimetype fixed
Comment 8 Julien Nabet 2013-09-01 20:00:15 UTC
Created attachment 85022 [details]
console + bt with symbols on master sources

On pc Debian x86-64 with master sources updated today, I reproduced the crash.

I attached console logs + bt.
Comment 9 Julien Nabet 2013-09-01 20:06:08 UTC
Here's some gdb session:
Breakpoint 1, SwUndo::SetSaveData (rDoc=..., rSData=...) at /home/julien/compile-libreoffice/libo/sw/source/core/undo/undobj.cxx:1034
1034	    SwPaM aPam( rDoc.GetNodes().GetEndOfContent() );
(gdb) n
1036	    for( sal_uInt16 n = rSData.size(); n; )
(gdb) list
1031	{
1032	    RedlineMode_t eOld = rDoc.GetRedlineMode();
1033	    rDoc.SetRedlineMode_intern( (RedlineMode_t)(( eOld & ~nsRedlineMode_t::REDLINE_IGNORE) | nsRedlineMode_t::REDLINE_ON ));
1034	    SwPaM aPam( rDoc.GetNodes().GetEndOfContent() );
1035	
1036	    for( sal_uInt16 n = rSData.size(); n; )
1037	        rSData[ --n ]->RedlineToDoc( aPam );
1038	
1039	#if OSL_DEBUG_LEVEL > 0
1040	    // check redline count against count saved in RedlineSaveData object
(gdb) n
1037	        rSData[ --n ]->RedlineToDoc( aPam );
(gdb) p n
$1 = 2
(gdb) n
1036	    for( sal_uInt16 n = rSData.size(); n; )
(gdb) n
1037	        rSData[ --n ]->RedlineToDoc( aPam );
(gdb) n
1036	    for( sal_uInt16 n = rSData.size(); n; )
(gdb) n
1041	    assert(rSData.empty() ||
(gdb) p rSData.empty()
$2 = false
(gdb) p rSData[0]->nRedlineCount
$3 = 2
(gdb) p rDoc.GetRedlineTbl().size()
$4 = 1
(gdb)
Comment 10 Julien Nabet 2013-09-01 20:06:58 UTC
Michael/Cédric: one for you?
Comment 11 Timur 2013-09-16 07:59:05 UTC
Any change this gets fixed for 4.1.2? It's a recent regression of major importance.
Comment 12 Timur 2013-09-16 11:53:37 UTC
Well, I tested with libreoffice-4-1~2013-09-14_14.29.02_LibreOfficeDev_4.1.3.0.0_Win_x86.msi and it doesn't happen.
Comment 13 Terrence Enger 2014-03-13 17:45:29 UTC
I have observed the problem with a debug build of master on Linux.


For specifity, to reproduce:

(1) Open new empty doc. in Writer.  Program displays document window
    "Untitled 1".

(2) Take menu optionas Edit > Changes.  Program displays submenu with
    Record not checked and Show checked.

(3) In the submenu click Show.  Focus returns to the document area.

(4) Type, without the quotation marks, "Some text".

(5) Take menu options Edit > Changs.  Program displays submenu with
    Record not checked and Show not checked.

(6) In the submenu click Show.  Focus returns to the document area,
    the caret is at the end of what you typed in step 4.

(7) Type <backspace> 5 times.  The caret is at the end of the word
    "Some".

(8) Type <ctrl>+Z.  Program issues the message
        soffice.bin: /home/terry/lo_hacking/git/libo4/sw/source/core/undo/undobj.cxx:1070: static void SwUndo::SetSaveData(SwDoc&, const SwRedlineSaveDatas&): Assertion `rSData.empty() || (rSData[0]->nRedlineCount == rDoc.GetRedlineTbl().size())' failed.
        Application Error
        Fatal exception: Signal 6
    and exits.


My LibreOffice is master commit 806f4d8, fetched 2014-03-04, configured:
    --enable-option-checking=fatal
    --enable-dbgutil
    --enable-crashdump
    --without-system-postgresql
    --without-myspell-dicts
    --with-extra-buildid
    --without-doxygen
    --with-external-tar=/home/terry/lo_hacking/git/src
built and running on debian-wheezy 64-bit.


For comparison, I do not see crash in version 4.2.2.1.
Comment 14 Terrence Enger 2014-03-13 17:48:35 UTC
Created attachment 95732 [details]
typescript of gdb on the core file
Comment 15 Joel Madero 2014-11-06 00:23:01 UTC
Because there is a bt log - moving to NEW as it was never reported as fixed. If this is no longer an issue with newer releases please close as WFM.
Comment 16 Terrence Enger 2014-11-06 01:01:00 UTC
I do not see a crash with LibreOffice from the daily dbgutil bibisect
repository, version 2014-11-04.
Comment 17 Terrence Enger 2014-11-06 01:05:02 UTC
I see that I was resonsible for REOPENED.  Setting WORKSFORME.