Bug 159377 - CRASH at undo at after pasting table in footer (swlo!SwFormatFootnote::SetNumStr+0x3e26:)
Summary: CRASH at undo at after pasting table in footer (swlo!SwFormatFootnote::SetNum...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+
Hardware: All All
: medium critical
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:25.8.0 target:25.2.1 target:24...
Keywords: bibisected, bisected
Depends on:
Blocks: Footnote-Endnote Undo-Redo Crash
  Show dependency treegraph
 
Reported: 2024-01-25 19:35 UTC by Telesto
Modified: 2025-01-31 10:36 UTC (History)
4 users (show)

See Also:
Crash report or crash signature: ["BigPtrArray::Index2Block"]


Attachments
Example file at step 3 (9.77 KB, application/vnd.oasis.opendocument.text)
2024-07-05 06:43 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2024-01-25 19:35:09 UTC
Description:
CRASH at undo at some point after table in footer (swlo!SwFormatFootnote::SetNumStr+0x3e26:)

Steps to Reproduce:
1. Open Writer
2. Insert a table 2x2
3. Insert a footnote below the table
4. Select the table cells 
5. CTRL+X
6. Enter the footnote
7. Type 'X'
8. Press arrow left
9. CTRL+V
10. CTRL+Z (notice X position being off
11. CTRL+V
12. CTRL+Z (4x) -> Crash

Actual Results:
Crash

Expected Results:
No crash, ideally. 


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 566bb271b8fe5882f24fef230e06c2af4ea12b33
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded
Comment 1 Stéphane Guillou (stragu) 2024-01-25 22:24:55 UTC
In 7.0 and 24.2.0.2, empty paragraphs are not inserted in the footnote and the crash occurs earlier, it only needs 2× Ctrl + Z at step 12 to crash. I get signature BigPtrArray::Index2Block : https://crashreport.libreoffice.org/stats/crash_details/677ff056-038d-4137-8ab5-8566556368cd and https://crashreport.libreoffice.org/stats/crash_details/7becba52-a8be-4467-8924-f92e5ddea4ed
Adding signature in field for that reason.

Repro as described in recent master build:

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

Possibly since bug 159025 or bug 159023 were fixed, but can't check currently without an update to linux-64-24.8 bibisect repo.
Comment 2 gladys 2024-07-03 20:16:11 UTC
bibisection windows  version 7.6 seem to point to

commit: 06b34d9f4b7967e87cd53e0effd98bfacfee2bb9
Date: 	Wed Mar 29 12:32:27 2023
author: Caolán McNamara <caolanm@redhat.com>
message: crashtesting: Null-deref on export of forum-mso-en4-274729.xls to ods
Comment 3 Buovjaga 2024-07-05 06:38:25 UTC
(In reply to gladys from comment #2)
> bibisection windows  version 7.6 seem to point to
> 
> commit: 06b34d9f4b7967e87cd53e0effd98bfacfee2bb9
> Date: 	Wed Mar 29 12:32:27 2023
> author: Caolán McNamara <caolanm@redhat.com>
> message: crashtesting: Null-deref on export of forum-mso-en4-274729.xls to
> ods

This result is not correct, because this is already seen in the oldest of 7.0.

I suppose the request here is to bibisect when we started needing 4 undos at step 12.
Comment 4 Buovjaga 2024-07-05 06:43:48 UTC
Created attachment 195113 [details]
Example file at step 3

For me, it crashes after 3 undos with latest master.
Comment 5 Stéphane Guillou (stragu) 2024-07-23 03:55:33 UTC
Bibisected with linux-64-24.8 repo to first bad build [e36d74f0757b01156606c65766a2b2bfcd836afd] which is:

commit fcd4222d36e1864452163e5c94976eea353bbaf0
author	Michael Stahl 	Mon Mar 04 15:45:07 2024 +0100
committer	Michael Stahl 	Wed Mar 06 10:45:57 2024 +0100
sw: SelectAll of section with RES_PAGEDESC corner-case
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164401

Michael, could you please have a look?
Comment 6 licorne_enragee@yahoo.fr 2024-07-23 14:52:31 UTC
Hi, I encounter a similar problem on my document since latest update.

The document recovery save is also crashing when this happens.

Here's the crash report: https://crashreport.libreoffice.org/stats/crash_details/c740b877-c18f-426c-bfd3-19be4ab74985
Comment 7 Commit Notification 2025-01-30 15:34:03 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3bbbe366e455f1b165f2f913fffd27f3a0e03a2d

tdf#159377 sw: fix undo of paste table into footnote

It will be available in 25.8.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 Commit Notification 2025-01-30 15:34:05 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3227660e55416254463234f35a43268b9b4c2c9e

(tdf#159377 related) sw: fix undo of table pasted in middle of paragraph

It will be available in 25.8.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 9 Michael Stahl (allotropia) 2025-01-30 15:37:53 UTC
fixed on master
Comment 10 Commit Notification 2025-01-31 10:26:57 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

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

tdf#159377 sw: fix undo of paste table into footnote

It will be available in 25.2.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 11 Commit Notification 2025-01-31 10:27:59 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/5468c6d32911dc68dc31b4c608d6eb9097f59b1f

(tdf#159377 related) sw: fix undo of table pasted in middle of paragraph

It will be available in 25.2.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 12 Commit Notification 2025-01-31 10:36:07 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#159377 sw: fix undo of paste table into footnote

It will be available in 24.8.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 13 Commit Notification 2025-01-31 10:36:09 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

(tdf#159377 related) sw: fix undo of table pasted in middle of paragraph

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