Bug Hunting Session
Bug 111524 - FILESAVE ODT: Crash while saving after deleting all comments
Summary: FILESAVE ODT: Crash while saving after deleting all comments
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha0+
Hardware: All All
: highest critical
Assignee: Michael Stahl (CIB)
URL:
Whiteboard: target:6.0.0
Keywords: bibisected, bisected, haveBacktrace, regression
: 111589 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-08-08 17:38 UTC by Telesto
Modified: 2017-08-21 13:57 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (983.83 KB, application/vnd.oasis.opendocument.text)
2017-08-08 20:11 UTC, Telesto
Details
gdb backtrace (52.78 KB, text/plain)
2017-08-08 21:52 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2017-08-08 17:38:52 UTC
Description:
Crash while saving after deleting all comments. 

Steps to Reproduce:
1. Open the attached file (ODT created from DOCX attachment 116933 [details] bug 92433)
2. Select a comment -> Delete a comments
3. Save the file (Save or Save as) -> Crash

Actual Results:  
Crash

Expected Results:
No Crash


Reproducible: Always

User Profile Reset: No

Additional Info:
Found in
Version: 6.0.0.0.alpha0+
Build ID: 386fcf9be786b302cd2c6f85ff6d8d97a6777926
CPU threads: 4; OS: Windows 6.19; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-08-06_01:57:50
Locale: nl-NL (nl_NL); Calc: CL

but not in
Version: 5.4.0.3
Build ID: 7556cbc6811c9d992f4064ab9287069087d7f62c
CPU threads: 4; OS: Windows 6.2; UI render: default; 
Locale: nl-NL (nl_NL); Calc: CL


User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Comment 1 Xisco Faulí 2017-08-08 18:34:57 UTC
LibreOffice freezes when I try to open the file. Does it happen to you as well?

Versió: 6.0.0.0.alpha0+
ID de la construcció: 0342c5e8086c8200ecadbe9d52dd4ef6a093effb
CPU threads: 4; OS: Linux 4.10; UI render: per defecte; VCL: gtk3; 
Configuració local: ca-ES (ca_ES.UTF-8); Calc: group
Comment 2 Telesto 2017-08-08 20:11:26 UTC
Created attachment 135318 [details]
Example file
Comment 3 Telesto 2017-08-08 20:28:12 UTC
(In reply to Xisco Faulí from comment #1)
> LibreOffice freezes when I try to open the file. Does it happen to you as
> well?

Sorry, forgot to add the ODT. The DOCX is broken and crashing LibO most of the time. For unknown reason I could open it with: Version: 6.0.0.0.alpha0+ Build ID: 386fcf9be786b302cd2c6f85ff6d8d97a6777926 and export it to ODT
Comment 4 Xisco Faulí 2017-08-08 21:38:06 UTC
Regression introduced by:

author	Michael Stahl <mstahl@redhat.com>	2017-07-07 11:26:50 (GMT)
committer	Michael Stahl <mstahl@redhat.com>	2017-07-07 13:49:01 (GMT)
commit	31c54fa7bb03768b425ae019096e0a0e26e9c736 (patch)
tree	fba4e0c0b0eaf35769a9461a277cf1521b91ba1a
parent	7b4f14e481846b90b124f2ff2b4ac0a6fc79f77b (diff)
sw: convert SwTextAnnotationField OSL_ENSUREs to assert() and simplify

Bisected with bibisect-linux64-6.0

Adding Cc: to Michael Stahl
Comment 5 Xisco Faulí 2017-08-08 21:52:49 UTC
Created attachment 135322 [details]
gdb backtrace
Comment 6 Xisco Faulí 2017-08-10 12:57:21 UTC
*** Bug 111589 has been marked as a duplicate of this bug. ***
Comment 7 Michael Stahl (CIB) 2017-08-11 19:39:22 UTC
repro:

1. create new writer doc
2. type "foo"
3. select "foo"
4. Ctrl+Alt+C, add some comment text
5. turn on Edit->Track Changes->Record
6. click comment menu, Delete Comment
7. Save As ODF
=>
soffice.bin: sw/source/core/unocore/unoportenum.cxx:300: void {anonymous}::{anonymous}::lcl_FillAnnotationStartArray(SwDoc&, SwUnoCursor&, {anonymous}::{anonymous}::SwAnnotationStartPortion_ImplList&): Assertion `pAnnotationFormatField != nullptr' failed.

it looks like the moving to and fro of the deleted comment during hiding & showing redlines destroys the association of the AnnotationMark and the SwPostItField; in lcl_FillAnnotationStartArray the SwPostItField has an empty name, so it's not found
Comment 8 Julien Nabet 2017-08-13 21:00:06 UTC
Michael: let's put this one to ASSIGNED since you assigned yourself :-)
Comment 9 Commit Notification 2017-08-21 13:54:32 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=685442bf71440e56fa8ae5a572d62f0a1e2c3200

tdf#111524 sw: delete annotation marks when creating delete redline

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 10 Commit Notification 2017-08-21 13:54:38 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

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

tdf#111524 sw: don't expand annotation mark when showing redline...

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 11 Michael Stahl (CIB) 2017-08-21 13:57:35 UTC
there were 2 different problems here, the 2nd one only affecting one of the annotations in the bugdoc.

whether the fix for the 2nd problem is an improvement or not remains to be seen...