Bug 123313 - Undoing ToC insertion in middle of word causes assertion failure
Summary: Undoing ToC insertion in middle of word causes assertion failure
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+ Master
Hardware: All All
: medium normal
Assignee: Michael Stahl (CIB)
URL:
Whiteboard: target:6.3.0 target:6.2.3
Keywords: haveBacktrace
Depends on:
Blocks: TableofContents-Indexes Assert Undo-Redo
  Show dependency treegraph
 
Reported: 2019-02-11 00:35 UTC by Aron Budea
Modified: 2019-03-04 23:41 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Backtrace (28.99 KB, text/plain)
2019-02-11 00:35 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2019-02-11 00:35:09 UTC
Created attachment 149072 [details]
Backtrace

The following can only be reproduced with a debug build.

- Add a word to an empty document.
- Change its style to Heading 2.
- Position cursor somewhere in the middle of the word, and add Table of Contents (no need to change anything in the dialog).
- Undo the ToC insertion.

=> LibreOffice crashes with an assertion failure:

soffice.bin: /build/sources/libreoffice/sw/source/core/crsr/crossrefbookmark.cxx:58: virtual void sw::mark::CrossRefBookmark::SetMarkPos(const SwPosition&): Assertion `rNewPos.nContent.GetIndex() == 0 && "<sw::mark::CrossRefBookmark::SetMarkPos(..)>" " - new bookmark position for cross-reference bookmark doesn't mark start of text node"' failed.

Observed using LO 6.3.0.0.alpha0+ (17e5028044edef2b959b73ce1dbe2c9627d1a799) / Ubuntu 18.04.
Comment 1 Durgapriyanka 2019-02-13 16:46:39 UTC
Thank you for reporting the bug. I can confirm the bug present. LO crashes when TOC is undone.

Version: 6.3.0.0.alpha0+
Build ID: b6b28931435e44aca92b8c0e1659f701e3ed1a87
CPU threads: 2; OS: Windows 6.1; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-01-30_06:57:04
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded
Comment 2 Aron Budea 2019-02-13 17:49:52 UTC
(In reply to Durgapriyanka from comment #1)
> Thank you for reporting the bug. I can confirm the bug present. LO crashes
> when TOC is undone.
Thanks for checking! Is this a regular daily build? I did not get a crash after undoing in a non-debug build. If you can, please submit a crash report generated with 6.2.0.3.

However, I got a crash even in a release build after hitting undo and redo a couple of times, I'll open a separate bug report on that.
Comment 3 Commit Notification 2019-03-04 10:11:27 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/60ea01af8c57f9b03ee1da1196284fa10025c22c%5E%21

tdf#123313 sw: workaround Undo problem with ToX Update

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Michael Stahl (CIB) 2019-03-04 10:13:15 UTC
was caused by cross-reference bookmarks; fixed on master
Comment 5 Commit Notification 2019-03-04 23:41:22 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/3e674fdca08b40bb18131c2490832647796d1301%5E%21

tdf#123313 sw: workaround Undo problem with ToX Update

It will be available in 6.2.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.