Bug 161705 - LO crashes with undo/redo of page numbering wizard's created bookmarks
Summary: LO crashes with undo/redo of page numbering wizard's created bookmarks
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.4.1 release
Hardware: All All
: high critical
Assignee: Justin L
URL:
Whiteboard: target:25.2.0 target:24.8.2 target:24...
Keywords: bibisected, bisected, haveBacktrace, regression
: 162095 (view as bug list)
Depends on:
Blocks: Undo-Redo Fields-Page-Number Crash
  Show dependency treegraph
 
Reported: 2024-06-20 07:05 UTC by Roman
Modified: 2024-09-05 13:56 UTC (History)
9 users (show)

See Also:
Crash report or crash signature: ["SwNodeIndex::SwNodeIndex(SwNode *)","SwPosition::SwPosition(SwNode const&, o3tl::strong_int<int, Tag_SwNodeOffset>)"]


Attachments
video.mp4 (899.77 KB, video/mp4)
2024-06-20 07:22 UTC, Roman
Details
bt (10.41 KB, text/plain)
2024-06-22 09:15 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman 2024-06-20 07:05:25 UTC
Description:
EN: LO falls into an error when the page numbering wizard is running.
RU: LO падает в ошибку при работе мастера нумерации страниц.


Steps to Reproduce:
1.Video
2.
3.

Actual Results:
EN: LO falls into an error when the page numbering wizard is running.
RU: LO падает в ошибку при работе мастера нумерации страниц.


Expected Results:
EN: LO does not fall into error when the page numbering wizard is running.
RU:LO не падает в ошибку при работе мастера нумерации страниц.



Reproducible: Always


User Profile Reset: Yes

Additional Info:
 I noticed it by chance
Comment 1 Roman 2024-06-20 07:22:31 UTC
Created attachment 194844 [details]
video.mp4
Comment 2 raal 2024-06-20 16:18:49 UTC
Confirm with Version: 24.8.0.0.beta1+ (X86_64) / LibreOffice Community
Build ID: 1b61abc4451d38984338b750d85770ec9871060a
CPU threads: 4; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded Jumbo

Page numbering wizzard is new feature https://wiki.documentfoundation.org/ReleaseNotes/7.6. Addin CC to Paris.
Comment 3 Roman 2024-06-20 17:32:20 UTC Comment hidden (no-value)
Comment 4 Julien Nabet 2024-06-22 09:14:57 UTC
Steps in English:
- launch Writer
- Menu "Insert" + select "Page Number"
- in "Position" (at the top), select "Top of page (Header)"
- click Ok
- Undo
- Redo
=> crash
Comment 5 Julien Nabet 2024-06-22 09:15:44 UTC
Created attachment 194906 [details]
bt

I got an assertion on pc Debian x86-64 with master sources updated today.
Comment 6 Julien Nabet 2024-06-22 09:18:14 UTC
Justin: since you worked with Paris about this, thought you might be also interested in this one.
Comment 7 Justin L 2024-06-22 13:40:18 UTC
(In reply to Julien Nabet from comment #4)
> - in "Position" (at the top), select "Top of page (Header)"
This is irrelevant. Same thing happens when inserted into the footer.

Using comment 4's steps, I bisected the crash to
commit 57974af130e7421da6b07589d4a63a754b757ad6
Author: Michael Stahl on Thu Nov 23 20:45:09 2023 +0100
    tdf#148389 sw: fix Delete Undo/Redo of bookmark positions

I have different steps that can reproduce a similar crash (bug 161741), but lets just leave this bug to focus on these particular steps. Ultimately though, the problem is bigger than just the page number wizard and bookmarks, and probably solving bug 161741 will eliminate the crash with these steps as well.
Comment 8 Justin L 2024-06-24 13:54:37 UTC
mstahl's patch was backported to 76.4 - mark that as the earliest affected.
Comment 9 Justin L 2024-07-19 11:59:28 UTC
*** Bug 162095 has been marked as a duplicate of this bug. ***
Comment 10 Stéphane Guillou (stragu) 2024-07-23 02:33:36 UTC
Justin has https://gerrit.libreoffice.org/c/core/+/170771 for review.
Comment 11 Justin L 2024-07-23 15:43:40 UTC
I have another (more dangerous) patch that also works at https://gerrit.libreoffice.org/c/core/+/170793
Comment 12 Commit Notification 2024-08-16 07:03:43 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0a9da9e43c53406c867fe95cdd5c7192ce08bcb6

tdf#161741 tdf#161705 undo: delay ClearRedo until Undo finishes

It will be available in 25.2.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 13 Justin L 2024-08-17 23:07:50 UTC
The crash has been avoid by preventing REDOs.

I'll mark the bug report as fixed, although there are still many fundamentals that likely will break under a different set of steps...
Comment 14 Commit Notification 2024-09-05 06:22:25 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#161741 tdf#161705 pgnum wizard: avoid undo crash (sledgehammer)

It will be available in 24.8.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.
Comment 15 Commit Notification 2024-09-05 13:56:19 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

tdf#161741 tdf#161705 pgnum wizard: avoid undo crash (sledgehammer)

It will be available in 24.2.7.

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.