Bug 168572 - Export to markdown: crash when Writer document contains a formula object
Summary: Export to markdown: crash when Writer document contains a formula object
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
26.2.0.0 alpha0+ master
Hardware: All All
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:26.2.0
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2025-09-27 13:10 UTC by RGB
Modified: 2025-10-12 19:37 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Writer document containing a formula object (15.23 KB, application/vnd.oasis.opendocument.text)
2025-09-27 13:10 UTC, RGB
Details
bt gdb (11.08 KB, text/plain)
2025-09-27 14:10 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RGB 2025-09-27 13:10:58 UTC
Created attachment 202992 [details]
Writer document containing a formula object

Testing the markdown import-export filters on 

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 432930279b5d2791efadf5d602fb426c59d10a48
CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

trying to export ("save as") to markdown, if the document contains a formula object, Writer crashes with a segment fault error. 

Steps to reproduce the bug:

1- open the attached file on a 26.2 alpha version
2- File → Save as → select "Markdown document (.md)" as filter

after the warning about using a non native format, LibreOffice crashes. 

Removing the formula object, the export proceeds without problems.
Comment 1 Julien Nabet 2025-09-27 14:10:28 UTC
Created attachment 202993 [details]
bt gdb

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

I attached bt + some gdb debug.

It seems we got an OLE node, not a graph node.
Comment 2 Julien Nabet 2025-09-27 14:11:07 UTC
Miklos: noticing fefd59b58c7d87e034fbf1c45cefa6a87ed09976
tdf#168172 sw markdown export: handle images

thought you might be interested in this one.
Comment 3 Julien Nabet 2025-09-27 14:59:38 UTC
I gave it a try with https://gerrit.libreoffice.org/c/core/+/191568
Comment 4 Julien Nabet 2025-09-27 15:04:15 UTC
(to put it clearly, the patch just avoids the crash, nothing more)
Comment 5 Commit Notification 2025-09-29 07:10:32 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6ed10a3e493a944d1e8462c46a6a98b7aff07d0b

tdf#168572: crash during markdown export when Writer doc contains a formula

It will be available in 26.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 6 Commit Notification 2025-09-29 12:59:11 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#168572: sw: Add test

It will be available in 26.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 7 RGB 2025-10-12 19:37:06 UTC
Verified on 

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ab0cec11466ee8f2b82c3bdbdad55b401546c8d3
CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

LibreOffice do not crash anymore. For the missing content (the Math object gets replaced by ![]() on export) I filled Bug 168827.