Bug 158360 - [CRASH] LibreOffice crashes after editing, closing and trying to reopen DOCX file
Summary: [CRASH] LibreOffice crashes after editing, closing and trying to reopen DOCX ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.3 release
Hardware: All All
: medium normal
Assignee: Balázs Varga (allotropia)
URL:
Whiteboard: target:24.8.0 target:7.6.6 target:24.2.1
Keywords: bibisected, bisected, haveBacktrace, possibleRegression
: 159970 (view as bug list)
Depends on:
Blocks: Crash
  Show dependency treegraph
 
Reported: 2023-11-24 18:12 UTC by Rafael Lima
Modified: 2024-03-27 04:53 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
DOCX File that causes the crash (717.39 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-11-24 18:12 UTC, Rafael Lima
Details
Backtrace (19.80 KB, text/plain)
2023-11-24 18:15 UTC, Rafael Lima
Details
gdb bt (21.07 KB, text/plain)
2023-11-24 19:47 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Lima 2023-11-24 18:12:35 UTC
Created attachment 191026 [details]
DOCX File that causes the crash

Since LO 7.6 I've been getting this problem very frequently. I can't pinpoint the root cause, so I'll describe what I usually do before this kind of crash.

I often receive DOCX files from my students, which are essays, dissertations, papers, etc. Then I open them with LO Writer, add various comments and do some minor editing. Then I save the file and send them back to my students.

This used to work almost flawlessly, but since 7.6 I have been getting a lot of crashes on these files. After editing and saving the files, if I try to reopen them, this will cause LO to crash.

However, the same file will open fine in OnlyOffice and WPS.

I attached a file that is now crashing LO Writer... the file was perfectly fine before editing it in LO Writer. After editing it and saving it, the file now crashes LO 7.6. However, I was able to open the file in LO 7.5.6.

Steps to reproduce:
1) Open attached file... it will crash on LO 7.6.x and newer
2) Open the same file using OnlyOffice/WPS... it will work
3) Open the file in LO 7.5.6... it will work as well

So this looks like a regression.

The file crashes in

Version: 7.6.3.2 (X86_64) / LibreOffice Community
Build ID: 60(Build:2)
CPU threads: 12; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+wayland)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 4:7.6.3~rc2-0ubuntu0.23.10.1~lo2
Calc: threaded

The file opens fine in

Version: 7.5.6.2 (X86_64) / LibreOffice Community
Build ID: f654817fb68d6d4600d7d2f6b647e47729f55f15
CPU threads: 12; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+wayland)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: threaded
Comment 1 Rafael Lima 2023-11-24 18:15:22 UTC
Created attachment 191027 [details]
Backtrace

Here's the backtrace... I couldn't find anything useful in it, but here it is anyway.
Comment 2 Julien Nabet 2023-11-24 19:47:59 UTC
Created attachment 191030 [details]
gdb bt

On pc Debian x86-64 with master sources updated today, I got an assertion.

I attached bt and some console logs.
Comment 3 Julien Nabet 2023-11-24 19:49:12 UTC
With LO Debian package 7.5.8.2, no pb to open the file.
Comment 4 Regina Henschel 2023-11-24 22:53:33 UTC
After a simple resave by Word, the file still crashes in LibreOffice.

But when I update the TOC in Word and then save, the file opens in LibreOffice.
Comment 5 Gianluca 2023-12-01 14:14:29 UTC
No repro:
Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 0c3f57487c9cc29d172121b178938cdb2a8adc7b
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: it-IT (it_IT); UI: it-IT
Calc: CL threaded
Comment 6 Aron Budea 2024-02-20 14:15:55 UTC
I can't say anything about the whole process and how the document could get in this state, but the attached file crashes on opening after the following commit, originally in 24.2, but also backported to 7.6 (and the crashing starts after this change in both bibisect repos):

https://cgit.freedesktop.org/libreoffice/core/commit/?id=da8dead8e9282010893cbd12519e107baf03cd1a
author		Balazs Varga <balazs.varga.extern@allotropia.de>	2023-06-20 19:26:50 +0200
committer	Balazs Varga <balazs.varga.extern@allotropia.de>	2023-06-29 09:29:34 +0200

tdf#73537 - sc: show author and creation date in calc comments
Comment 7 Commit Notification 2024-02-21 19:37:32 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7cf3d5e3073dc5cffc64b6d9b32513e90087a3d4

tdf#158360 - sw, ooxml import - fix insertTextPortion crash

It will be available in 24.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 2024-02-22 07:26:44 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/64248c5d42bbf46eeb4c41e79dd0b5e4a360e280

tdf#158360 - sw, ooxml import - fix insertTextPortion crash

It will be available in 24.2.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 9 Commit Notification 2024-02-22 10:15:06 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/656540497a555cc23d66881c3b987cc93ba2203c

tdf#158360 - sw, ooxml import - fix insertTextPortion crash

It will be available in 7.6.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 10 Commit Notification 2024-02-22 11:27:23 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "libreoffice-24-2-1":

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

tdf#158360 - sw, ooxml import - fix insertTextPortion crash

It will be available in 24.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 Rafael Lima 2024-02-22 20:10:56 UTC
Thanks Balázs for the fix.

The file now opens fine in:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 52806e4c1e241d12419373cb0ed013356e12c4b8
CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL threaded
Comment 12 Stéphane Guillou (stragu) 2024-03-27 04:53:56 UTC
*** Bug 159970 has been marked as a duplicate of this bug. ***