Bug 168964 - FILESAVE DOCX Exported document can freeze or crash Word on open
Summary: FILESAVE DOCX Exported document can freeze or crash Word on open
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: All All
: lowest trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: DOCX-Corrupted DOCX-OLE-Objects
  Show dependency treegraph
 
Reported: 2025-10-20 06:31 UTC by Aron Budea
Modified: 2026-01-09 19:01 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
ooo52593-1.odt (15.43 KB, application/vnd.oasis.opendocument.text)
2025-10-20 06:31 UTC, Aron Budea
Details
ooo52593-1RT70.docx: not actually corrupt... (17.07 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2026-01-09 14:27 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2025-10-20 06:31:29 UTC
Created attachment 203449 [details]
ooo52593-1.odt

The attached ODT, ooo52593-1.odt is from an old AOO bug report. Save it into DOCX, and try opening it in Word.

=> Word will hang or crash trying to open the DOCX.

Observed with LO 26.2.0.0.alpha0+ (8ea8e254a3151f5390f3a10ff156fcaf8e7c5d5c), 7.0.0.3 / Windows.

This is a regression from the following commit in 7.0
https://git.libreoffice.org/core/commit/2150fdc7d0f63288ac56c33cb898589512057642
author		Attila Bakos <bakos.attilakaroly@nisz.hu>	Thu Apr 09 17:10:22 2020 +0200
committer	László Németh <nemeth@numbertext.org>	Tue Apr 28 10:18:08 2020 +0200

"tdf#131539 DOCX export: fix position of OLE objects"

In the saved DOCX before the change, in word/document.xml, one can find the following:
<v:shape id="ole_rId2" style="width:35.3pt;height:17.05pt" o:ole="">

This changes with the fix:
<v:shape id="ole_rId2" style="position:absolute;margin-left:10.8pt;margin-top:9.2pt;width:35.3pt;height:17.05pt;mso-position-horizontal-relative:text;mso-position-vertical-relative:text" o:ole="">

Such changes are the cause of the hang/crash.
Comment 1 fpy 2025-10-21 04:06:05 UTC
One could argue -> NOTOURBUG :/

Anyhow, would make sense to specify what version of Word/OS is concerned.
Comment 2 Aron Budea 2025-10-21 07:47:26 UTC
(In reply to fpy from comment #1)
> One could argue -> NOTOURBUG :/
Office generally saves files in a way that doesn't crash their software, and Writer should produce such documents as well, as the main purpose of using DOCX format is interoperability.

Tested with Word 2013 and 2019.
Comment 3 Justin L 2026-01-09 14:27:24 UTC Comment hidden (no-value)
Comment 4 Justin L 2026-01-09 15:54:00 UTC
(In reply to Aron Budea from comment #2)
> (In reply to fpy from comment #1) One could argue -> NOTOURBUG :/
> Office generally saves files in a way that doesn't crash their software,

I would tend to agree with fpy on this one.
It looks and sounds like a layout bug. LO does this all the time - it saves files in a way that crashes when it is loaded because of a layout loop or whatever. It really has nothing to do with "the way it is saved".

Simply removing frame3's position:absolute out of the style="..." avoids the hang.

However, so does removing frame2 altogether... so that pretty much proves that the style="..." is not the problem.
Comment 5 Aron Budea 2026-01-09 16:37:50 UTC
(In reply to Justin L from comment #4)
> It looks and sounds like a layout bug. LO does this all the time - it saves
> files in a way that crashes when it is loaded because of a layout loop or
> whatever. It really has nothing to do with "the way it is saved".
I don't think the conclusion that sometimes your saved files can't be opened afterwards is an acceptable resolution to such problems.

Sure, in LO you have the option to tweak any part of the software, and tweaking the layout code is the most straightforward place (albeit still complicated), but with MSO you obviously don't have that option. Which leaves us with tweaking the export code as the only option, provided we can figure out what part causes the problem, and what is the smallest adjustment to avoid it.

> However, so does removing frame2 altogether... so that pretty much proves
> that the style="..." is not the problem.

The problem is that the result crashes Word, and the change can be anything that keeps the file close to the original, while not freezing or crashing Word.

Let me reopen this, because even though a layout loop in Word isn't our bug, the bug will never go away. I guess someone could report this to MS and see if they react... either way, let's just track this issue here for now.
Comment 6 Justin L 2026-01-09 19:01:12 UTC
(In reply to Aron Budea from comment #5)
> The problem is that the result crashes Word, and the change can be anything
> that keeps the file close to the original

Any change you make is going to break valid/necessary properties for some other document. You never 'fix a document'. You always 'fix something wrong'. Of course, it is always possible that something really is wrong here, but good luck finding it.