Bug 163325 - Crashes on Editing TOC when Preview is on
Summary: Crashes on Editing TOC when Preview is on
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.7.2 release
Hardware: x86-64 (AMD64) All
: highest critical
Assignee: Andreas Heinisch
URL:
Whiteboard: target:25.2.0 target:24.8.5 target:24...
Keywords: bibisected, bisected, haveBacktrace, regression
: 163517 163766 163825 163827 163879 163882 163933 164086 164451 164464 164569 (view as bug list)
Depends on:
Blocks: TableofContents-Indexes-Dialog Crash
  Show dependency treegraph
 
Reported: 2024-10-06 13:37 UTC by Jens Schwartz
Modified: 2025-01-15 10:05 UTC (History)
23 users (show)

See Also:
Crash report or crash signature: ["SwSectionFrame::SwClientNotify(SwModify const &,SfxHint const &)"]


Attachments
bt (4.90 KB, text/plain)
2024-11-13 16:56 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Schwartz 2024-10-06 13:37:50 UTC
Description:
Just faced crashes repeatingly when trying to edit or create TOC.

As per crash report signature all of the belong to "SwSectionFrame" and crashreport.libreoffice.org shows[1] a LARGE amount of this type crashes - on Windows 10 only.

For me the crashes only appeared when trying to edit or create TOC in existing .ODTs.

No crashes when managing TOC in a completely new documents (not saved + opened)

[1] 
 https://crashreport.libreoffice.org/stats/signature/SwSectionFrame::SwClientNotify(SwModify%20const%20&,SfxHint%20const%20&)

Steps to Reproduce:

Steps in general:
Create: Menu > Insert > Table of Contents > Table of Contents, Index...
Edit: Right-Click on existing TOC > Edi index

A
  1. Open an existing .ODT
  2. Try to Create a TOC or to Edit (if present)
  3. Crash

B
  1. Create new .ODT
  2. Try to Create a TOC and to Edit
  3. NO Crash
  4. Save + Close
  5. Reopen
  6. Try to Create a TOC or to Edit (if present)
  7. Crash
  
Updating an existing TOC works.


Actual Results:
Update Indes works fine.
Create or Edit in existing file causes crash in 100% of cases

Expected Results:
should not crash :)


Reproducible: Always


User Profile Reset: No

Additional Info:
Tested on multiple devices


Private laptop, Win10, private MS account:

Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 16; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL threaded

--> Crash

Company laptop, Win 10, company MS account

Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 8; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: threaded

--> Crash

Private laptop, !!! Win11 !!!, other private MS account:

Version: 24.8.1.2 (X86_64) / LibreOffice Community
Build ID: 87fa9aec1a63e70835390b81c40bb8993f1d4ff6
CPU threads: 8; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded

--> NO crash
Comment 1 m_a_riosv 2024-10-06 20:12:50 UTC
Please test in safe mode, Menu/Help/Restart in Safe Mode
Comment 2 Jens Schwartz 2024-10-09 10:01:14 UTC
(In reply to m_a_riosv from comment #1)
> Please test in safe mode, Menu/Help/Restart in Safe Mode

Hi,

tested in safe mode on one of the devices -> no crash.

On this device no addons or plugins for LO were installed ever. (that's why I chose it).

On this device, after test in safe mode, I renamed the directory %AppData%\Roaming\LibreOffice\4\user and tested again -> no crash.

Will test it later on the other device too.
For now it looks like the former profile didn't fully fit with the updated LO and letting LO re-create a new one solved the problem. (Anyhow I think isn't a nice "solution". ^^)
Comment 3 Jens Schwartz 2024-10-09 21:58:59 UTC
(In reply to m_a_riosv from comment #1)
> Please test in safe mode, Menu/Help/Restart in Safe Mode

Test on the other Win10 device -> exactly the same behavor

Safe mode -> no crash

Normal mode -> crash again

Reset LO user profile -> no crash

Hence I'm pretty sure that the updated version has trouble using the old user profile in scope of editing TOC.
Comment 4 Jens Schwartz 2024-10-09 22:02:49 UTC
(In reply to m_a_riosv from comment #1)
> Please test in safe mode, Menu/Help/Restart in Safe Mode

On device 2 now removed the new profile folder & renamed the old one back to "user" -> Crash again.

Above analysis is valid AFAICS
Comment 5 m_a_riosv 2024-10-10 10:05:11 UTC
It's difficult to find what the issue can be with the profile.

Some test
- Changing the Skia options in Menu>Tools>Options>LibreOffice>View
- Verifying if Menu>Tools>Options>LibreOffice>OpenCL is enabled, if not maybe  related with graphics driver.
Something with the above, try updating the graphics driver from the vendor, not only windows update.
- Try resetting Writer options to default. Begin with Compatibility options.
Comment 6 Henner Drewes 2024-11-08 08:30:56 UTC
Confirming the issue on Win 10 and MacOs:

Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 19045); UI render: default; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL threaded

Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 8; OS: macOS 12.7.6; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

The graphics settings (hardware acceleration, anti-aliasing, skia etc.) do not have effect.
Also OpenCL enable/disable do not make a difference.

However, the problematic detail is the preview in ToC dialog.
If preview is disabled -> no crash
If preview is enabled -> crash
If ToC dialog is opened, and preview was disabled before -> no crash
If ToC dialog is open, and then preview checkbox is clicked -> crash
Comment 7 Stéphane Guillou (stragu) 2024-11-11 13:31:09 UTC
Also crashed for me on Ubuntu 24.04.

1. Create new ODT
2. Insert > TOC > TOC, turn Preview on in dialog, click OK
3. Right-click > Edit index/TOC: no crash
4. Save file
5. Reload
6. Right-click > Edit index/TOC: crash

https://crashreport.libreoffice.org/stats/crash_details/9547da5a-004f-4c0e-883e-61732152d591

Looking at the crash reports, it might have started with 24.2.7 and 24.8.1.

Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 8; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

Also in:

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5cf912b08e4a22f66ab1ec5fa601ba3e50e3c4cc
CPU threads: 8; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded
Comment 8 Stéphane Guillou (stragu) 2024-11-11 13:31:24 UTC
*** Bug 163825 has been marked as a duplicate of this bug. ***
Comment 9 Stéphane Guillou (stragu) 2024-11-11 13:31:32 UTC
*** Bug 163766 has been marked as a duplicate of this bug. ***
Comment 10 Stéphane Guillou (stragu) 2024-11-11 13:42:59 UTC
bibisected with linux-64-24.8 repo to first bad build [f40175e28627fbddbed439f6b503cb8f9ca8ccd3] which points to core commit aff04bbcde8cbc0bcbf94041713447fbc9ce896a which is a cherrypick of:

commit a97e245ba11598050e1800fde9ace796d20e9df2
author	Michael Stahl 	Thu Aug 29 13:27:03 2024 +0200
committer	Michael Stahl  Fri Aug 30 13:44:34 2024 +0200
sw: layout: fix page breaks when unhiding a hidden section
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172609

It also made it into 24.2.7 as 806b94a73949e714e9cedb4533616f27c15ef9f1. 

Michael, can you please have a look?
Comment 11 Stéphane Guillou (stragu) 2024-11-11 13:46:49 UTC
I also checked that the 24.2 branch cherrypick 806b94a73949e714e9cedb4533616f27c15ef9f1 indeed introduces the crash too for 24.2.7. That's build [e58f89aa6855a081c6aed3694f2cbb2c792267b6] in the linux-64-24.2 bibisect repo.
Comment 12 Stéphane Guillou (stragu) 2024-11-11 14:01:22 UTC
*** Bug 163827 has been marked as a duplicate of this bug. ***
Comment 13 Stéphane Guillou (stragu) 2024-11-13 12:41:50 UTC
*** Bug 163879 has been marked as a duplicate of this bug. ***
Comment 14 richaire@gmail.com 2024-11-13 15:29:18 UTC
Turn off Preview? Where do I turn off preview - what am I preveiwing?
Comment 15 Julien Nabet 2024-11-13 16:56:18 UTC
Created attachment 197600 [details]
bt

On pc Debian x86-64 with master sources updated today, I could reproduce this after following Stéphane's comment https://bugs.documentfoundation.org/show_bug.cgi?id=163325#c7 (thank you Stéphane for the precise step-by-step process!)
Comment 16 Stéphane Guillou (stragu) 2024-11-14 04:55:31 UTC
(In reply to richaire@gmail.com from comment #14)
> Turn off Preview? Where do I turn off preview - what am I preveiwing?

In the "Insert > Table of Contents > Table of Contents" dialog, there should be a "Preview" tick box at the bottom.
Comment 17 B. Antonio Fernández 2024-11-15 07:55:17 UTC
I think this bug may be related to Bug 162195
Comment 18 Julien Nabet 2024-11-17 09:23:47 UTC
*** Bug 163933 has been marked as a duplicate of this bug. ***
Comment 19 Dave 2024-11-19 01:49:12 UTC
This is my first crash report / comment. Please bear with me . . .

This describes what's happening to me:  "Just faced crashes repeatingly when trying to edit or create TOC." Windows 11 

Started when I was writing a 50 page report with hierarchal sub levels. Tried to edit the ToC and as soon as I rightclick on Edit Table, CRASH

I've done this on LO for years and just now it crashes. Tried to create a ToC for a trivial report: crashed

I'm going to try to run it in Safe Mode.
Comment 20 Stéphane Guillou (stragu) 2024-11-20 06:26:07 UTC
*** Bug 163882 has been marked as a duplicate of this bug. ***
Comment 21 vort3 2024-11-24 09:23:56 UTC
(In reply to Stéphane Guillou (stragu) from comment #7)
> Also crashed for me on Ubuntu 24.04.
> 
> 1. Create new ODT
> 2. Insert > TOC > TOC, turn Preview on in dialog, click OK
> 3. Right-click > Edit index/TOC: no crash
> 4. Save file
> 5. Reload
> 6. Right-click > Edit index/TOC: crash

Also happened to me with these exact steps on Archlinux.

I don't know how to make it send a crash report, I see no dialog that suggests me to send a crash report, unfortunately.

Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 480(Build:1)
CPU threads: 16; OS: Linux 6.11; UI render: default; VCL: kf6 (cairo+wayland)
Locale: en-US (en_US.UTF-8); UI: en-US
24.8.2-2
Calc: threaded
Comment 22 Andreas Heinisch 2024-11-25 08:21:36 UTC
Proposed patch: https://gerrit.libreoffice.org/c/core/+/177234

This patch does only handle the symptoms and not necessarily the cause of this problem.
Comment 23 Achmad Fathoni 2024-11-26 08:39:15 UTC
Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 480(Build:1)
CPU threads: 20; OS: Linux 6.11; UI render: default; VCL: kf6 (cairo+wayland)
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

For me, deleting the user profile via safe mode fixes this bug.
Comment 24 Mario 2024-11-26 21:10:52 UTC
I had the same bug. 
Using Windows 10. Build 19045
Using 24.8.3. 

Then downgrading to 24.2.7.
The same.

Theo downgrading to 24.2.3. 433d9c2ded56988e8a90e6b2e771ee4e6a5ab2ba

Normal behavior.
Comment 25 Commit Notification 2024-11-29 12:17:14 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2145204724049cad1585743c0b980ed2c6561212

tdf#163325 - Check Lower() frame during ToC preview

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 26 Stéphane Guillou (stragu) 2024-11-29 14:12:48 UTC
(In reply to Achmad Fathoni from comment #23)
> For me, deleting the user profile via safe mode fixes this bug.
My understanding is that's because the default setting is to have the Preview off. Removing your profile resets that setting.
Comment 27 Xisco Faulí 2024-11-29 14:16:55 UTC
*** Bug 164086 has been marked as a duplicate of this bug. ***
Comment 28 Stéphane Guillou (stragu) 2024-12-01 03:26:02 UTC
Verified with own build: 

Version: 25.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 9f25e61d0e9bbd762ef6da063c16c65e53c9c980
CPU threads: 8; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

Thank you Andreas!
Comment 29 Commit Notification 2024-12-02 10:00:35 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#163325 - Check Lower() frame during ToC preview

It will be available in 24.8.5.

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 30 Commit Notification 2024-12-02 11:23:47 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/02a5a4c4341df534ff1c42465e87ca25e63eec4e

tdf#163325: uitest: load the saved document

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 31 Andreas Heinisch 2024-12-02 12:59:12 UTC
I hope this is the right place to do this, but I would like to express my gratitude to vort3 for sponsoring this bug and bringing it to my attention.
Comment 32 Commit Notification 2024-12-10 03:17:53 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-24-8-4":

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

tdf#163325 - Check Lower() frame during ToC preview

It will be available in 24.8.4.

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 33 Mike Kaganski 2024-12-25 07:30:43 UTC
Hmm, I just confirmed bug 164451 using v.24.8.4.2 - which, it seems, must have the fix...
Comment 34 BogdanB 2024-12-25 09:56:11 UTC
This bug is for Windows/Linux, but https://bugs.documentfoundation.org/show_bug.cgi?id=164451 seems Windows specific.
Comment 35 Mike Kaganski 2024-12-25 10:52:38 UTC
*** Bug 164451 has been marked as a duplicate of this bug. ***
Comment 36 BogdanB 2024-12-26 08:45:31 UTC
*** Bug 164464 has been marked as a duplicate of this bug. ***
Comment 37 BogdanB 2024-12-27 01:57:39 UTC
*** Bug 163517 has been marked as a duplicate of this bug. ***
Comment 38 BogdanB 2025-01-03 19:28:05 UTC
*** Bug 164569 has been marked as a duplicate of this bug. ***