Bug 160827 - Crash on opening certain .docx files
Summary: Crash on opening certain .docx files
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.2.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:24.8.0 target:24.2.3 target:7....
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2024-04-26 03:19 UTC by daniel
Modified: 2024-05-06 17:24 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example document (715.88 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-04-26 03:19 UTC, daniel
Details
gdb bt (72.35 KB, text/plain)
2024-04-26 17:34 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description daniel 2024-04-26 03:19:05 UTC
Created attachment 193857 [details]
Example document

$ libreoffice "/home/doconnor/Downloads/updated-specifications-for-revisions-to-the-victorian-admitted-episodes-dataset-(vaed)-for-2024.docx"

Immediate crash.

Unfortunately, I don't have any other useful error logs, output or similar to help classify further.
Comment 1 Bogaboga Man 2024-04-26 11:28:45 UTC
Was able to confirm crash, but when I converted file to ODT using https://www.zamzar.com/convert/docx-to-odt/ I opened the file without incident.
My environment:
Version: 24.2.2.2 (X86_64) / LibreOffice Community
Build ID: d56cc158d8a96260b836f100ef4b4ef25d6f1a01
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 m_a_riosv 2024-04-26 11:52:05 UTC
Crash without any notice also with:
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ea43cbbb7371a743f470d949762a0e92f196e652
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded
Comment 3 Julien Nabet 2024-04-26 17:34:22 UTC
Created attachment 193870 [details]
gdb bt

On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 4 Julien Nabet 2024-04-26 20:54:37 UTC
The pb is precisely on this line:
2744 if (xPropertySet->getPropertyValue("_MarkAsFinal").get<bool>())

#1  0x00007f209d0388c6 in com::sun::star::uno::Any::get<bool>() const (this=0x7ffca817d5f0) at include/com/sun/star/uno/Any.hxx:687
#2  0x00007f209d5ee7d5 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) (this=0x559694cfc470, rMedium=..., xInsertPosition=empty uno::Reference)
    at sfx2/source/doc/objstor.cxx:2744
#3  0x00007f209d5dba75 in SfxObjectShell::DoLoad(SfxMedium*) (this=0x559694cfc470, pMed=0x559694d151e0) at sfx2/source/doc/objstor.cxx:762
#4  0x00007f209d666846 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x559694d02c10, seqArguments=uno::Sequence of length 15 = {...})
    at sfx2/source/doc/sfxbasemodel.cxx:1980
#5  0x00007f209d82a76e in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) (this=0x559691eabf70, rArgs=uno::Sequence of length 12 = {...}, _rTargetFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x55969195f4b0) at sfx2/source/view/frmload.cxx:720
#6  0x00007f209e5e0898 in framework::LoadEnv::impl_loadContent() (this=0x559691ae7988) at framework/source/loadenv/loadenv.cxx:1176

László: thought you might be interested in this one since it's related to 9a5c56a9c4e04589b0a6bb710573922e459d9685
tdf#107690 OOXML import/export of setting "Open as read-only"
Comment 5 Julien Nabet 2024-04-26 21:22:11 UTC
Patch on review here:
https://gerrit.libreoffice.org/c/core/+/166763
Comment 6 Commit Notification 2024-04-28 09:40:02 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

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

tdf#160827: fix crash when retrieving _MarkAsFinal value (docx)

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 7 Julien Nabet 2024-04-28 09:40:44 UTC
Fix for 24.2 branch waiting for review here:
https://gerrit.libreoffice.org/c/core/+/166724
Comment 8 Commit Notification 2024-04-28 11:12:11 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5158104b9294ab85ab7a675b5b627469e303c345

Revert "tdf#160827: fix crash when retrieving _MarkAsFinal value (docx)"

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 9 Julien Nabet 2024-04-28 11:18:20 UTC
I reverted the patch following Noel's good advice here:
https://gerrit.libreoffice.org/c/core/+/166797

I've just submitted a new one here:
https://gerrit.libreoffice.org/c/core/+/166798
Comment 10 Commit Notification 2024-04-28 18:10:48 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/45d2d90d2354a6a32297cde52c0041915499b19b

tdf#160827: fix crash when retrieving _MarkAsFinal value (docx) (take 2)

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 11 Commit Notification 2024-04-29 08:24:16 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

tdf#160827: fix crash when retrieving _MarkAsFinal value (docx) (take 2)

It will be available in 24.2.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 12 Commit Notification 2024-04-29 16:45:36 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

tdf#160827: fix crash when retrieving _MarkAsFinal value (docx) (take 2)

It will be available in 7.6.8.

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 Commit Notification 2024-04-29 18:23:56 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-24-2-3":

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

tdf#160827: fix crash when retrieving _MarkAsFinal value (docx) (take 2)

It will be available in 24.2.3.

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 14 Commit Notification 2024-04-30 07:37:41 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#160827: sw_ooxmlexport20: Add unittest

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 15 Commit Notification 2024-05-06 17:24:04 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-6-7":

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

tdf#160827: fix crash when retrieving _MarkAsFinal value (docx) (take 2)

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