Bug 74790 - Document comparison causes assertion failure in SwpHintsArray::Check
Summary: Document comparison causes assertion failure in SwpHintsArray::Check
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: Other All
: highest normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:4.3.0 target:4.2.5
Keywords: regression
Depends on:
Blocks: mab4.2
  Show dependency treegraph
 
Reported: 2014-02-10 13:09 UTC by Jan Holesovsky
Modified: 2014-09-10 14:22 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Base document. (10.56 KB, application/vnd.oasis.opendocument.text)
2014-02-10 13:11 UTC, Jan Holesovsky
Details
Document to compare (to be loaded via Edit -> Compare Documents). (10.72 KB, application/vnd.oasis.opendocument.text)
2014-02-10 13:11 UTC, Jan Holesovsky
Details
bt with symbols (7.72 KB, text/plain)
2014-03-06 20:43 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Holesovsky 2014-02-10 13:09:23 UTC
The following creates an infinite loop in master, and crashes 4.2 (both dbgutil build, but probably no better in the release one):

* open the attached document-comparison-loop-1.odt
* Edit -> Compare Documents, choose document-comparison-loop-2.odt
* see LibreOffice 4.2 crashing or master entering infinite loop :-)

Backtrace:

#0  0x00007ffff74d63d5 in raise () from /lib64/libc.so.6
#1  0x00007ffff74d7858 in abort () from /lib64/libc.so.6
#2  0x00007ffff74cf2e2 in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007ffff74cf392 in __assert_fail () from /lib64/libc.so.6
#4  0x00007fffc6dd0829 in SwpHintsArray::Check (this=0x7fffdc205000, bPortionsMerged=true)
    at /local/libreoffice/libreoffice-4-2/sw/source/core/txtnode/ndhints.cxx:308
#5  0x00007fffc6debe78 in SwTxtNode::CopyText (this=0x7fffcc0802c0, pDest=0x7fffcc8fe2b8, rDestStart=..., rStart=..., nLen=
    8, bForceCopyOfAllAttrs=false) at /local/libreoffice/libreoffice-4-2/sw/source/core/txtnode/ndtxt.cxx:1789
#6  0x00007fffc6a06860 in SwDoc::CopyImpl (this=0x281b100, rPam=..., rPos=..., bMakeNewFrms=true, bCopyAll=false, pCpyRange=
    0x7fffcc8fd640) at /local/libreoffice/libreoffice-4-2/sw/source/core/docnode/ndcopy.cxx:1037
#7  0x00007fffc6a05296 in SwDoc::CopyRange (this=0x281b100, rPam=..., rPos=..., bCopyAll=false)
    at /local/libreoffice/libreoffice-4-2/sw/source/core/docnode/ndcopy.cxx:701
#8  0x00007fffc687aaee in SwCompareLine::ChangesInLine (this=0x2868e30, rLine=..., rpInsRing=@0x7fffffffc000: 0x0, rpDelRing=
    @0x7fffffffc008: 0x0) at /local/libreoffice/libreoffice-4-2/sw/source/core/doc/doccomp.cxx:1375
#9  0x00007fffc687bb9a in SwCompareData::CheckForChangesInLine (this=0x7fffffffbfa0, rData=..., rStt=@0x7fffffffbee0: 0, 
    rEnd=@0x7fffffffbef0: 1, rThisStt=@0x7fffffffbed8: 0, rThisEnd=@0x7fffffffbee8: 1)
    at /local/libreoffice/libreoffice-4-2/sw/source/core/doc/doccomp.cxx:1601
#10 0x00007fffc68777cd in CompareData::ShowDiffs (this=0x7fffffffbfa0, rData=...)
    at /local/libreoffice/libreoffice-4-2/sw/source/core/doc/doccomp.cxx:397
#11 0x00007fffc687cc36 in SwDoc::CompareDoc (this=0x127f100, rDoc=...)
    at /local/libreoffice/libreoffice-4-2/sw/source/core/doc/doccomp.cxx:1804
#12 0x00007fffc6abb6d7 in SwEditShell::CompareDoc (this=0x13348d0, rDoc=...)
    at /local/libreoffice/libreoffice-4-2/sw/source/core/edit/editsh.cxx:898
#13 0x00007fffc736391f in SwView::InsertMedium (this=0x13efec0, nSlotId=6586, pMedium=0x27f03c0, nVersion=0)
    at /local/libreoffice/libreoffice-4-2/sw/source/ui/uiview/view2.cxx:2180
#14 0x00007fffc73649d6 in SwView::DialogClosedHdl (this=0x13efec0, _pFileDlg=0x27bf970)

etc.
Comment 1 Jan Holesovsky 2014-02-10 13:11:08 UTC
Created attachment 93770 [details]
Base document.
Comment 2 Jan Holesovsky 2014-02-10 13:11:51 UTC
Created attachment 93771 [details]
Document to compare (to be loaded via Edit -> Compare Documents).
Comment 3 Jan Holesovsky 2014-02-10 13:12:28 UTC
Not sure what's the impact; but I guess this might be a mab.
Comment 4 sophie 2014-02-11 16:48:33 UTC
Hi Kendy, just for information, I do not reproduce with Version: 4.2.0.4
Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71 on Ubuntu 13.10 x64. I can compare the two documents, accept or reject your modification, no loop for me - Sophie
Comment 5 Jorendc 2014-02-13 15:36:13 UTC
(In reply to comment #4)
> Hi Kendy, just for information, I do not reproduce with Version: 4.2.0.4
> Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71 on Ubuntu 13.10 x64. I
> can compare the two documents, accept or reject your modification, no loop
> for me - Sophie

Looks like a debug-build only bug. This because of the assertion that is raised. /me currently doesn't have a debugbuild.

@Kendy: can you confirm this is debug-only :)?

Kind regards,
Joren
Comment 6 gibi 2014-02-16 13:39:01 UTC
No problem (accepting, rejecting is ok) with Version: 4.2.1.1
Build ID: d7dbbd7842e6a58b0f521599204e827654e1fb8b on Linux X64 DEB.


Perhaps this bug could be dedicated to debugbuild.
And so this bug shouldn't stay in MAB ?
Comment 7 bfoman (inactive) 2014-02-19 21:18:19 UTC
Checked with:
Version: 4.2.1.1
Build ID: d7dbbd7842e6a58b0f521599204e827654e1fb8b
Windows 8.1 Enterprise 64 bit

Could not reproduce. No crash.
Comment 8 Julien Nabet 2014-03-06 20:43:04 UTC
Created attachment 95240 [details]
bt with symbols

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

Indeed, I've got this on my autogen.input:
--enable-debug
--enable-dbgutil

I attached the bt which is very similar.
Comment 9 Jorendc 2014-03-06 21:18:11 UTC
@Kendy, Julien: not sure this assert does affect/warn for a bug which can cause information loss/high risk for crashers/regression... If not, you agree to remove this from the mab4.2 list?
Comment 10 Julien Nabet 2014-03-06 22:39:24 UTC
Jorendc: I just wanted to confirm the bug. For the rest, I don't know and I'll let Jan speak :-)
Comment 11 Björn Michaelsen 2014-03-16 01:12:30 UTC
Fix priority for MABs.
Comment 12 Michael Stahl (allotropia) 2014-05-07 16:06:01 UTC
obviously regression from 6db39dbd7378351f6476f6db25eb7110c9cfb291

the document compare is a bit of a special case because the document
is loaded but has no layout, so these asserts don't really matter...

fixed on master

(why is an assertion-only/debug-only bug a MAB?)
Comment 13 Commit Notification 2014-05-07 16:06:49 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=80b131038d2375c9855ee5fbe225e75bdad2645e

fdo#74790: sw: Compare Document: fix assertions about RSID-only hints



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 14 Jorendc 2014-05-07 17:01:49 UTC
(In reply to comment #12)
> (why is an assertion-only/debug-only bug a MAB?)

Because a well-known developer did mark as such :-). I, and other QA-ers, are not eager to overrule such decision :-).

Glad it is fixed though! Thanks Michael!
Comment 15 Commit Notification 2014-05-08 07:52:39 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8fb7fa143cca628654933459135eee6c3f1450d4&h=libreoffice-4-2

fdo#74790: sw: Compare Document: fix assertions about RSID-only hints


It will be available in LibreOffice 4.2.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.