Bug 161741 - LO crashes with undo/redo of new header + some other change
Summary: LO crashes with undo/redo of new header + some other change
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2 all versions
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace, implementationError
Depends on:
Blocks: Writer-Header-Footer Undo-Redo Crash
  Show dependency treegraph
 
Reported: 2024-06-22 13:36 UTC by Justin L
Modified: 2024-06-28 11:33 UTC (History)
4 users (show)

See Also:
Crash report or crash signature: ["SwUndoInsert::RedoImpl(sw::UndoRedoContext%20&)"]


Attachments
bt (5.46 KB, text/plain)
2024-06-28 10:13 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2024-06-22 13:36:48 UTC
Steps to reproduce the crash
- launch Writer
- Menu "Insert" -> Header and Footer -> Header -> Default Style
* enter "something" in the header
* use the undo dropdown to undo everything, including "Header/footer changed" (in one step) 
- Redo
=> crash

Notes: header or footer is irrelevant. The method of creating the header/footer is irrelevant (I used the in-header-area + button in testing).

The ability to undo/redo the "Header/footer change" started in
bibisect-linux-64-7.2 commit 910d9a081daf11ea53235d227c3dc9623942a824
commit 8d8486f43c1a8a51157bfc3e0b87090b05a9229e
Author: Daniel Arato (NISZ) on Mon Feb 22 16:59:38 2021 +0100
    tdf#46561 sw: fix lost undo stack setting header/footer

At first, (at least for these particular steps) undo/redo worked. Then for a short time the undo cleared the redo list, until the crash started with
bibisect-linux-64-7.2 commit 68d3f7ef5385a8c5717131fcd0f98e3fca9da825
commit 0cd000bb83719982c1fd2265ea040c82af5bf98e
Author: Daniel Arato (NISZ) on Mon Apr 26 15:04:17 2021 +0200
    tdf#141613 sw: avoid possible crash when undoing header creation
        We still need to call ClearRedo() because
        there is no mechanism in place to Redo a header/footer change.
Comment 1 Bogaboga Man 2024-06-22 15:29:43 UTC
I can confirm this bug.

Problem is that the crash report indicated to be at https://crashreport.libreoffice.org/stats/crash_details/8a4c3af4-eaf7-43e3-840f-86e475f355b8 is not available! I am using this environment: - 

Version: 24.2.4.2 (X86_64) / LibreOffice Community
Build ID: 51a6219feb6075d9a4c46691dcfe0cd9c4fff3c2
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: en-CA (en_CA); UI: en-GB
Calc: CL threaded
Comment 2 Xisco Faulí 2024-06-27 08:58:38 UTC
it's only happening when using the undo/redo buttons
Comment 3 Julien Nabet 2024-06-27 19:44:56 UTC
On pc Debian x86-64 with master sources updated today, I don't reproduce this.
Comment 4 Justin L 2024-06-27 23:09:09 UTC
(In reply to Xisco Faulí from comment #2)
> it's only happening when using the undo/redo buttons

Perhaps - but only because that is the easiest way to undo multiple actions in one step. The "redo" step can be achieved via Ctrl+Y or the menu and still cause the crash.

The key in reproducing is to undo both "typing: something" and "Header/footer change" in one step.
Comment 5 Julien Nabet 2024-06-28 10:13:49 UTC
Created attachment 195034 [details]
bt

On pc Debian x86-64 with master sources updated today, I could reproduce this.

I hadn't undone both actions in the same time.

I also noticed this log on console when undoing both actions:
warn:svl:529888:529888:svl/source/undo/undo.cxx:1084: SfxUndoManager::MarkTopUndoAction(): suspicious call!
Comment 6 Julien Nabet 2024-06-28 10:19:41 UTC
I noticed that if I undo the last action only (the "something" type), I can redo this.
But if I undo the last action, then the initial action (the header), I can't redo this.