Bug 152964 - Crash on undo deletion of table with track changes enabled
Summary: Crash on undo deletion of table with track changes enabled
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.7.2 release
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0 target:7.5.1 target:7.4.6
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks: Undo-Redo Crash Track-Changes-Table
  Show dependency treegraph
 
Reported: 2023-01-10 15:25 UTC by Telesto
Modified: 2023-02-13 14:26 UTC (History)
2 users (show)

See Also:
Crash report or crash signature: https://crashreport.libreoffice.org/stats/crash_details/6c7f63fc-0a38-4c5c-ae90-ec0a79d6611a


Attachments
bt with debug symbols + console logs (7.74 KB, text/plain)
2023-01-10 18:18 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2023-01-10 15:25:06 UTC
Description:
Crash on undo deletion of table with track changes enabled

Steps to Reproduce:
1. Open Writer
2. Edit -> Track changes -> Record ON | Show OFF
3. Table picker toolbar -> Insert 2x2 table (no difference with table -> Table dialog)
4. Place the cursor in the bottom row
5. Press delete table row button (2x)
6. press CTRL+Z (Crash)

Actual Results:
Crash

Expected Results:
No crash


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 12e8d57e791bb1befc0716d4d02af7d1d1ccb4ae
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded
Comment 1 Telesto 2023-01-10 15:26:01 UTC
@Julien
A backtrace would be nice, if reproducible of course.
Comment 2 Julien Nabet 2023-01-10 18:18:07 UTC
Created attachment 184565 [details]
bt with debug symbols + console logs

Here's a bt with console logs retrieved on pc Debian x86-64 with master sources updated today and gtk3 rendering + brand new LO profile
Comment 3 Telesto 2023-01-10 19:17:06 UTC
No crash with
Version: 7.1.8.0.0+ (x64) / LibreOffice Community
Build ID: a94b58277c7aeaa83ce14347cd0b8f7137969d03
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 4 Telesto 2023-01-10 22:49:14 UTC
@László
You might be interested in this one
Comment 5 Stéphane Guillou (stragu) 2023-01-11 13:22:52 UTC Comment hidden (obsolete)
Comment 6 Stéphane Guillou (stragu) 2023-01-11 13:31:35 UTC
Apologies, not sure what went wrong in my previous test, but I can reproduce since 7.3:

Not reproduced in:

Version: 7.2.7.2 / LibreOffice Community
Build ID: 8d71d29d553c0f7dcbfa38fbfda25ee34cce99a2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Reproduced since:

Version: 7.3.7.2 / LibreOffice Community
Build ID: e114eadc50a9ff8d8c8a0567d6da8f454beeb84f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Bibisecting now.
Comment 7 Stéphane Guillou (stragu) 2023-01-11 14:51:16 UTC
Bibisecting with linux-64-7.3 repo was pretty tricky as crashes happened differently at different points, or not at all. In chronological order:

1. crashing when deleting the second row (no need for Ctrl + Z), bisected to the repo's 995a3a3f73bfd5e80403cd0ae746e6237a3c2f9d (core commit 426930d0c4bd6f782a04a92e8a36e92cd65e186f)

2. delete row 3 times to make the table disappear, then Ctrl + Z 5 times to make LO crash since at least the repo's 463117e80d43604eaa5393e17157cee96d954248 (core commit 6b6400d72fe4112b230ffe31b9bea7d2a7f2f9f4)

3. can't delete even one row, can't crash it, since at least the repo's 7ea7afe50f0c3fd8b08f4f78b264e583f31dd154 (core commit 81f90d4ab51ec7528fa2a9b14c0426a634971580)

4. delete rows twice, the second time does not seem to do anything (left with a 1-row table) but is necessary to then crash LO with Ctrl + Z

5. delete rows twice, table is gone, crash LO with Ctrl + Z, since at least the repo's 74eec907c4c643877bab29f953b71706d32b7faa (core commit 0d65d4c6b7272f4ca8e413e025db234e5c8c7722)

I took (4) to be the issue that needs bibisecting, given how similar it was to (5). It took me to commit af0c74b56551080d3c7509636f43ae92c5be35fa which points to core commit dc3f29bca53ef365ec12694feefe76f0e81eccfa which is a cherry-pick of:

commit a74c51025fa4519caaf461492e4ed8e68bd34885
author	László Németh <nemeth@numbertext.org>	Mon Feb 28 12:35:27 2022 +0100
committer	László Németh <nemeth@numbertext.org>	Mon Feb 28 16:32:08 2022 +0100
tree 4fe70555f7e01acb7eea745029185b87dc1a14ab
parent 6fb261607810fb0d542c0818f60a3f9bead33032
tdf#146962 sw: hide deleted row at deletion in Hide Changes
In Hide Changes mode, deleting table rows with change tracking
wasn't applied on the table layout immediately, only using Show
Changes and Hide Changes again. Now the deleted row removed from
the table instead leaving an empty table row (except the last
row of a wholly deleted table).
See also commit 95213407dfcbf34056037d60243ff915340d1a2e
"tdf#146622 sw crash fix: don't delete already deleted rows".
Change-Id: I864957cafa38e631a65db0670c7b566cb689f4cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130701

Telesto guessed László needed contacting without an involved bibisect! :D
Comment 8 Telesto 2023-01-11 16:20:30 UTC
(In reply to Stéphane Guillou (stragu) from comment #7)
> Telesto guessed László needed contacting without an involved bibisect! :D
Educated guess ;-) László expanded track changes to track the deletion tables/table rows. And well this introduced a couple of bugs already. 

However it's always nice to have a conformation with a bibisect. Thanks!
Comment 9 Commit Notification 2023-01-18 15:43:18 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4e72e646255624eda698da750383a5725e8f6c4c

tdf#152964 sw: fix crash of Undo of tracked deletion of empty table rows

It will be available in 7.6.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 10 László Németh 2023-01-18 16:31:02 UTC
Telesto, Stéphane: many thanks for the report and feedback!

Commit description:

tdf#152964 sw: fix crash of Undo of tracked deletion of empty table rows

In Hide Changes mode, Undo of insertion of CH_TXT_TRACKED_DUMMY_CHAR
(workaround of the deletion of empty table rows), resulted a crash
because of inconsistency of table and redline nodes. As a workaround,
skip that insertion from the Undo.

Regression from commit a74c51025fa4519caaf461492e4ed8e68bd34885
"tdf#146962 sw: hide deleted row at deletion in Hide Changes".
Comment 11 NISZ LibreOffice Team 2023-01-25 13:21:11 UTC
Verified in:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 0bb90afaeb193181d7b98b79e962549d8a1dd85a
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL threaded
Comment 12 Commit Notification 2023-02-09 11:43:28 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/6d47b8a09f51357851cdfa752f231ed10328b8f2

tdf#152964 sw: fix crash of Undo of tracked deletion of empty table rows

It will be available in 7.5.1.

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 13 Commit Notification 2023-02-13 12:00:24 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

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

tdf#152964 sw: fix crash of Undo of tracked deletion of empty table rows

It will be available in 7.4.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 14 Commit Notification 2023-02-13 14:26:40 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6732191ebf8a559b272238c03af679263abf86ef

tdf#152964: sw: move UItest to CppUnittest

It will be available in 7.6.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.