Bug 150594 - LO 7.4: crash when I update a chapter index (swlo!SwDoc::SetTOXBaseName+0x5cd:)
Summary: LO 7.4: crash when I update a chapter index (swlo!SwDoc::SetTOXBaseName+0x5cd:)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All All
: high major
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.5.0 target:7.4.1
Keywords: haveBacktrace, regression
Depends on:
Blocks:
 
Reported: 2022-08-25 07:17 UTC by Paolo Piattica
Modified: 2022-08-28 19:29 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
here the file that causes the crash (12.35 MB, application/vnd.oasis.opendocument.text)
2022-08-25 07:18 UTC, Paolo Piattica
Details
Smaller example (1.15 MB, application/vnd.oasis.opendocument.text)
2022-08-25 14:07 UTC, Telesto
Details
gdb bt (5.70 KB, text/plain)
2022-08-25 15:59 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Piattica 2022-08-25 07:17:23 UTC
Description:
no problems with 7.3.5

There is a general index: updating it, no problem
Each chapter has its chapter index: updating it I get an immediate problem;
I tried for study to change the chapter index to general index: updating it no problem

Steps to Reproduce:
1.open file go to a chapter index
2.update index

Actual Results:
Libreoddice crashes

Expected Results:
LO ask to send report and then ask to recover


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
---
Comment 1 Paolo Piattica 2022-08-25 07:18:25 UTC
Created attachment 182008 [details]
here the file that causes the crash
Comment 2 Telesto 2022-08-25 14:07:37 UTC
Created attachment 182019 [details]
Smaller example

1. Open the attached file
2. Sidebar -> Navigator -> Expand Indexes 
3. Right Click Table of Content 5 and Select Update -> Crash 

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 1c1647e6ee252fe68d7406d01043e88f1721590f
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
Comment 3 Julien Nabet 2022-08-25 15:59:44 UTC
Created attachment 182027 [details]
gdb bt

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

I attached bt with a bit of gdb.
Comment 4 Julien Nabet 2022-08-25 16:06:56 UTC
Regression from: 1cac7d18ab8561f129a30d6c93c0f9f1d7868e01
tdf#130318 - Use the actual cursor position to create ToC "for chapter"
Use the actual cursor position to create ToC "for chapter" beginning at
the current level.

Andreas/Ilmari: thought you might be interested in this one.
Comment 5 Andreas Heinisch 2022-08-25 16:58:44 UTC
Will take a look the next days when I find some spare time 🤗
Comment 6 Andreas Heinisch 2022-08-25 19:58:54 UTC
Pending review: https://gerrit.libreoffice.org/c/core/+/138850#

I had the check for the position, but I could not think of a scenario where this case could happen. I added it again to prevent any crash, if we are already at the top level of the chapter node.

Didn't check the correctness of the index though.
Comment 7 Commit Notification 2022-08-25 21:02:22 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/33c6dcfaab35a70f8794a67d31fbec636cb485d5

tdf#150594 - Prevent crash while searching for the next outline node

It will be available in 7.5.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 Julien Nabet 2022-08-26 06:39:23 UTC
On pc Debian x86-64 with master sources updated today, I confirm I don't reproduce the crash (I thought it would have been a bit more complicated than this :-)).
Thank you Andreas!
Comment 9 Commit Notification 2022-08-27 12:24:50 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/5f03dc914d67725b4d8e949d4e2198c4e9b537ec

tdf#150594 - Prevent crash while searching for the next outline node

It will be available in 7.4.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 10 Commit Notification 2022-08-27 13:14:22 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-7-4-1":

https://git.libreoffice.org/core/commit/716f3e73fcedc4c4c107527a49aaec604a7e2c63

tdf#150594 - Prevent crash while searching for the next outline node

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