Bug 130680 - CRASH: cutting content of document
Summary: CRASH: cutting content of document
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.0.0.alpha0+
Hardware: All All
: medium major
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:7.0.0 target:6.4.2 target:6.3.6
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks: redlinehide-regressions
  Show dependency treegraph
 
Reported: 2020-02-15 10:24 UTC by Xisco Faulí
Modified: 2020-11-19 11:09 UTC (History)
3 users (show)

See Also:
Crash report or crash signature: ["SwTextNode::AddToListRLHidden()"]


Attachments
bt with debug symbols (41.15 KB, text/plain)
2020-02-15 10:45 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2020-02-15 10:24:43 UTC
Steps to reproduce:
1. Open attachment 81619 [details] from bug 66302
2. Select all
3. Cut

-> Crash

Reproduced in

Version: 7.0.0.0.alpha0+
Build ID: 54acab919e7c7c5d60fc697bda54278861ac250e
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 1 Xisco Faulí 2020-02-15 10:25:48 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=b86ff2c6a88aa41379e74f11e8ec8497ff85ffd0

author	Michael Stahl <Michael.Stahl@cib.de>	2019-08-09 16:41:19 +0200
committer	Michael Stahl <Michael.Stahl@cib.de>	2019-08-09 19:04:42 +0200
commit b86ff2c6a88aa41379e74f11e8ec8497ff85ffd0 (patch)
tree 8118fd648bf0e9ca6806103760404f9be66cf297
parent f6a7dee56c984f36261c75a1056cc3a5bf43b2f1 (diff)
tdf#118699 sw_redlinehide: need some more changes to use the last node
... as property node for the merged frame.

Bisected with: bibisect-linux64-6.4

Adding Cc: to Michael Stahl
Comment 2 Julien Nabet 2020-02-15 10:45:56 UTC
Created attachment 157886 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 3 Julien Nabet 2020-02-15 10:46:24 UTC
Crash+regression => let's increase a bit the importance
Comment 4 Commit Notification 2020-03-04 09:30:24 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4769f431d93139eb3c470e5bb4e7c3c33d46a41f

tdf#130680 sw_redlinehide: fix crash in SwUndoDelete

It will be available in 7.0.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 5 Michael Stahl (allotropia) 2020-03-04 10:39:34 UTC
fixed by https://gerrit.libreoffice.org/c/core/+/89896

there is a follow-up problem: if you Undo the delete, then we hit the assert:

sw/source/core/undo/undobj.cxx:1450: static void SwUndo::SetSaveData(SwDoc&, SwRedlineSaveDatas&): Assertion `rSData.empty() || (rSData[0].nRedlineCount == rDoc.getIDocumentRedlineAccess().GetRedlineTable().size())' failed.

the one delete redline that is inserted on 
  <SwPaM> = SwPaM = {
    point = SwPosition (node 2497, offset 65),
    mark = SwPosition (node 528, offset 138)
  }, 

is split into 560 separate redlines by questionable code added in commit dc9a0b124272a6dc0a8d875d51b6f882e60a8a04 "tdf#127101 Change tracking: reject format at paragraph join" - of course you're supposed to get the same situation after Undo as initially...
Comment 6 Commit Notification 2020-03-04 15:25:06 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/2ef34d0272fca823ca5d5e795343e8a8ebced583

tdf#130680 sw_redlinehide: fix crash in SwUndoDelete

It will be available in 6.4.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.
Comment 7 Commit Notification 2020-03-05 09:09:27 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e4208eb2c067afe77eb85699b9951d4a5df599f3

tdf#130680: Add unittest

It will be available in 7.0.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 8 Xisco Faulí 2020-03-05 09:14:29 UTC
(In reply to Michael Stahl (CIB) from comment #5)
> fixed by https://gerrit.libreoffice.org/c/core/+/89896
> 
> there is a follow-up problem: if you Undo the delete, then we hit the assert:

Hi Michael,
Indeed the unitttest ( https://git.libreoffice.org/core/commit/e4208eb2c067afe77eb85699b9951d4a5df599f3 ) caught this assert so I commented that out. If you plan to fix it, just uncomment it afterwards
Comment 9 Michael Stahl (allotropia) 2020-03-05 09:41:25 UTC
(In reply to Xisco Faulí from comment #8)
> (In reply to Michael Stahl (CIB) from comment #5)
> > fixed by https://gerrit.libreoffice.org/c/core/+/89896
> > 
> > there is a follow-up problem: if you Undo the delete, then we hit the assert:
> 
> Hi Michael,
> Indeed the unitttest (
> https://git.libreoffice.org/core/commit/
> e4208eb2c067afe77eb85699b9951d4a5df599f3 ) caught this assert so I commented
> that out. If you plan to fix it, just uncomment it afterwards

good to have a test for it; i'm not sure i have a budget currently to fix other people's redlining bugs.
Comment 10 Xisco Faulí 2020-03-05 09:52:58 UTC
(In reply to Michael Stahl (CIB) from comment #9)
> good to have a test for it; i'm not sure i have a budget currently to fix
> other people's redlining bugs.

Ok, will report it in a follow-up ticket. Setting this one to VERIFIED

Version: 7.0.0.0.alpha0+
Build ID: bdfd0feefe3785e1ea68bf1f1f987147c8fe9335
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

@Michael, thanks for fixing it!
Comment 11 Commit Notification 2020-03-06 14:36:39 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/commit/f46a47ca136b0430dfec73831e532f4ae4d7474b

tdf#130680 sw_redlinehide: fix crash in SwUndoDelete

It will be available in 6.3.6.

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 12 Commit Notification 2020-03-10 15:22:25 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-4-2":

https://git.libreoffice.org/core/commit/95b8c9569745f57ad644627242ffffc8b799c8a4

tdf#130680 sw_redlinehide: fix crash in SwUndoDelete

It will be available in 6.4.2.

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.