Bug 140606 - PDF: EXPORT: Crash in: mergedlo.dll
Summary: PDF: EXPORT: Crash in: mergedlo.dll
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
7.1.0.3 release
Hardware: All All
: high major
Assignee: Tomaz Vajngerl
URL:
Whiteboard: target:7.2.0 target:7.1.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2021-02-22 17:58 UTC by Thibaut Cuvelier
Modified: 2021-03-04 17:04 UTC (History)
3 users (show)

See Also:
Crash report or crash signature: ["mergedlo.dll"]


Attachments
File that makes Draw crash (6.19 MB, application/vnd.oasis.opendocument.graphics)
2021-02-22 17:58 UTC, Thibaut Cuvelier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thibaut Cuvelier 2021-02-22 17:58:18 UTC
Created attachment 169971 [details]
File that makes Draw crash

This bug was filed from the crash reporting server and is br-fca88dae-1526-4962-80a6-a8c8249d6e8c.
=========================================

I am trying to export the attached ODG file (created from two scanned PDF files) as a 2-page PDF file. However, it reliably crashes on my (very old: 2007) machine.

To reproduce: open the attached ODG, File > Export as > Export directly as PDF, select a destination file, Save.

If I do File > Export as > Export as PDF and let everything by default, except check Lossless compression and disable Reduce image resolution, it does the same.

In safe mode, it's the same. 

I installed LibreOffice today, there are no addins. 

Version of LibreOffice: https://git.libreoffice.org/core/+log/f6099ecf3d29644b5008cc8f48f42f4a40986e4c

Version of Windows: 10 1909, build 18363.13679, x64 (no update available)

Machine: Intel Core 2 Duo E6750, 4 GB of RAM
Comment 1 Thibaut Cuvelier 2021-02-25 21:14:41 UTC
After a few Windows updates, I still get the same crash, but the trace seems different: https://crashreport.libreoffice.org/stats/crash_details/8b3bd0c0-4b87-49b1-8d55-26bcbff09c5e
Comment 2 Xisco Faulí 2021-03-01 12:39:46 UTC
Reproduced in

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 43e306ebe61ef5a849dcfd1e74b697be3b3fe716
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 3 Xisco Faulí 2021-03-01 12:52:19 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=c724c1bec549f224656e7ca3290494159dda7e26

author	Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>	2020-10-28 13:55:23 +0100
committer	Tomaž Vajngerl <quikee@gmail.com>	2020-11-02 20:11:03 +0100
commit	c724c1bec549f224656e7ca3290494159dda7e26 (patch)
tree	0447dfeba6192a3e021d3f04355e5060e7d13c12
parent	be1eeabaae38f4890a55cd206f22b03818253fb6 (diff)
pdf: deduplicate resources when copying from external PDF stream

Bisected with: bibisect-linux64-7.1

Adding Cc: to Tomaž Vajngerl
Comment 4 Tomaz Vajngerl 2021-03-02 09:57:24 UTC
Hm.. PDF file has an unexpected null character in the stream, which causes the crash because the document can't be correctly read. I have fixed the export so a bad PDF doesn't crash LibreOffice and made the parser more lenient to ignore a null character and tries to continue.
Comment 5 Commit Notification 2021-03-03 01:00:49 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

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

tdf#140606 make PDF parsing more lenient and prevent a crash

It will be available in 7.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 Xisco Faulí 2021-03-03 08:14:15 UTC
Verified in

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 0b072e279f5f775a4cd64d9b1275e5ab17d50f05
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Tomaž Vajngerl, thanks for fixing this issue. Should it be closed as RESOLVED FIXED ?
Comment 7 Commit Notification 2021-03-03 08:15:41 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

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

tdf#140606 make PDF parsing more lenient and prevent a crash

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