Bug 99692 - FILEOPEN: Crash on opening odt with change tracking
Summary: FILEOPEN: Crash on opening odt with change tracking
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.5.0.0.alpha0+ Master
Hardware: All All
: medium major
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:5.2.0 target:5.1.4 target:6.0....
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2016-05-05 12:21 UTC by Aurimas Fišeras
Modified: 2017-08-24 21:32 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Crashes after opening (32.73 KB, application/vnd.oasis.opendocument.text)
2016-05-05 12:21 UTC, Aurimas Fišeras
Details
Back trace (7.92 KB, text/plain)
2016-05-05 12:22 UTC, Aurimas Fišeras
Details
bt + console logs (7.64 KB, text/plain)
2016-05-05 17:23 UTC, Julien Nabet
Details
gdb info about nodes (15.05 KB, text/plain)
2016-05-05 17:27 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aurimas Fišeras 2016-05-05 12:21:41 UTC
Created attachment 124859 [details]
Crashes after opening

Open attached file - LibreOffice opens, then crashes.

Tried with LibO 5.1.2.2 on 32-bit Windows, 64-bit Ubuntu.
Also tried with 5.2.0.0.alpha1+ (6943396614bb223e05a9de36e7bbc955ed8e6492) on 64-bit Ubuntu.

Google Docs opens this file.
Comment 1 Aurimas Fišeras 2016-05-05 12:22:19 UTC
Created attachment 124860 [details]
Back trace
Comment 2 Ronald Baby 2016-05-05 13:24:32 UTC
Unconfirmed in Kubuntu 16.04 64bits Libreoffice version 5.1.2.2. Libreoffice works as expected .
Comment 3 raal 2016-05-05 13:50:27 UTC
I can confirm with  Version: Version: 5.2.0.0.alpha1+ and 4.5; win7
Comment 4 Julien Nabet 2016-05-05 17:23:01 UTC
Created attachment 124870 [details]
bt + console logs

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

I attached console logs + bt + some gdb session trace
Comment 5 Julien Nabet 2016-05-05 17:27:34 UTC
Created attachment 124871 [details]
gdb info about nodes

Notice these:
(gdb) p rNds
$5 = (SwNodes &) @0x2fdab60: {<BigPtrArray> = BigPtrArray of length 726 = {

so we expect an array of 726 whereas last node in it is:
[ 199]  0x63a8730            TextNode "POREIKIS:"...}, m_vIndices = 0x30094a8, m_pMyDoc = 0x2feb570, m_pEndOfPostIts = 0x2fd6160, m_pEndOfInserts = 0x2fc1600, 
  m_pEndOfAutotext = 0x2fd30d0, m_pEndOfRedlines = 0x2feb900, m_pEndOfContent = 0x2fd9b80, m_pOutlineNodes = 0x2fd9bc0, m_bInNodesDel = false, m_bInDelUpdOutline = false, 
  m_bInDelUpdNum = false}

then this:
(gdb) p mrSidebarItem.maLayoutInfo.mnStartNodeIdx
$4 = 538

So indeed, these lines from sw/source/uibase/docvw/SidebarWin.cxx can't work:
    895                 SwContentNode* const pContentNd = rNds[mrSidebarItem.maLayoutInfo.mnStartNodeIdx]->GetContentNode();
    896                 SwPosition aStartPos( *pContentNd, mrSidebarItem.maLayoutInfo.mnStartContent );
Comment 6 Commit Notification 2016-05-13 12:43:23 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=833029e751432e9e736c4f38f23654511d26e8f9

Resolves: tdf#99692 crash in SwPostItMgr with change tracking

It will be available in 5.2.0.

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 7 Caolán McNamara 2016-05-13 12:46:32 UTC
makes it not crash at least
Comment 8 Michael Stahl (allotropia) 2016-05-13 15:39:23 UTC
(In reply to Julien Nabet from comment #5)
> so we expect an array of 726 whereas last node in it is:
> [ 199]  0x63a8730            TextNode "POREIKIS:"...}

no, that is just the default gdb setting of printing only the first 200 elements of an array.

you can change that with "set print elements 1000" or whatever.

also the nodes-array always ends with an EndNode, not a TextNode.
Comment 9 Commit Notification 2016-05-13 16:00:30 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c767b5534eaea688138a49653f51df7bc321181e&h=libreoffice-5-1

Resolves: tdf#99692 crash in SwPostItMgr with change tracking

It will be available in 5.1.4.

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 10 Julien Nabet 2016-05-13 17:08:06 UTC
(In reply to Michael Stahl from comment #8)
> (In reply to Julien Nabet from comment #5)
> > so we expect an array of 726 whereas last node in it is:
> > [ 199]  0x63a8730            TextNode "POREIKIS:"...}
> 
> no, that is just the default gdb setting of printing only the first 200
> elements of an array.
> 
> you can change that with "set print elements 1000" or whatever.
> 
> also the nodes-array always ends with an EndNode, not a TextNode.

Thank you for the tip! I'll try to keep this in mind for next time :-)
Comment 11 Michael Stahl (allotropia) 2017-07-21 21:28:23 UTC
now fixed the root-cause of the invalid mark indexes on master,
as it was triggering an assert in sw::mark::AnnotationMark::InitDoc()
Comment 12 Commit Notification 2017-07-21 21:29:25 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=850795942b3e168cab8ce88b4f2b421945ff29ca

tdf#99692 sw: fix bookmark positions in tables at start of redlines

It will be available in 6.0.0.

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 13 Commit Notification 2017-07-27 15:29:59 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=be2a7025e5b62e9dab73886436ee52d5330ae381&h=libreoffice-5-3

tdf#99692 sw: fix bookmark positions in tables at start of redlines

It will be available in 5.3.6.

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 Commit Notification 2017-07-27 15:31:32 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1272e9aba878192f138247d732b6deca13f36176&h=libreoffice-5-4

tdf#99692 sw: fix bookmark positions in tables at start of redlines

It will be available in 5.4.1.

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 15 Commit Notification 2017-08-18 15:44:22 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6a018363791945b6fd7f04f2aa311e4f4753f6aa

tdf#99692 sw: fix the fix: don't set bNullContent if node was split

It will be available in 6.0.0.

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 16 Commit Notification 2017-08-22 17:59:10 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3ddc16fc26a06a95b7e373ee930881f91b22ad1f&h=libreoffice-5-3

tdf#99692 sw: fix the fix: don't set bNullContent if node was split

It will be available in 5.3.6.

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 17 Commit Notification 2017-08-23 14:40:32 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cac440fd5a76f4a76565466cd9df363f5634e8bd&h=libreoffice-5-4

tdf#99692 sw: fix the fix: don't set bNullContent if node was split

It will be available in 5.4.2.

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 18 Commit Notification 2017-08-24 21:32:59 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-4-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b99f9c9559b9a3a2aa6337bb87be0ea1767ee7a7&h=libreoffice-5-4-1

tdf#99692 sw: fix the fix: don't set bNullContent if node was split

It will be available in 5.4.1.

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.