Bug 42374 - LO Poppler library extremely slow to open page 4 with shaded fills of attached PDF
Summary: LO Poppler library extremely slow to open page 4 with shaded fills of attache...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.4.3 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: confirmed:4.2.1:OSX target:5.1.0 targ...
Keywords: perf
: 50573 61523 (view as bug list)
Depends on:
Blocks: PDF-Import-Draw
  Show dependency treegraph
 
Reported: 2011-10-29 10:05 UTC by Hanno Boeck
Modified: 2021-05-15 09:22 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments
pdf file causing libreoffice to hang (456.32 KB, application/pdf)
2011-10-29 10:05 UTC, Hanno Boeck
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hanno Boeck 2011-10-29 10:05:54 UTC
Created attachment 52896 [details]
pdf file causing libreoffice to hang

I accidently tried to open the attached pdf file with libreoffice and it caused it to hang completely (my work on a text in another window was lost).
Comment 1 tester8 2011-11-15 01:07:00 UTC
Reproduced with

LO 3.4.4
Ubuntu 10.04.3 x86
Linux 2.6.32-35-generic Russian UI
Comment 2 Thomas Arnhold 2013-04-15 03:55:45 UTC
Confirmed on Windows, too. Version 4.0.2.2 (Build ID: 4c82dcdd6efcd48b1d8bba66bfe1989deee49c3).
Comment 3 vvort 2014-02-22 08:58:10 UTC
LibreOffice is not hanging!
If you wait ~10 minutes, it will finish it's work.
The problem is in too complex (for LO right now) picture on page #4.
Comment 4 retired 2014-02-22 20:35:22 UTC
Confirmed:4.2.1:OSX

CPU madness and LO unresponsive for quite some time.
Comment 5 vvort 2015-02-01 05:54:32 UTC
*** Bug 50573 has been marked as a duplicate of this bug. ***
Comment 6 vvort 2015-02-01 05:54:53 UTC
*** Bug 61523 has been marked as a duplicate of this bug. ***
Comment 7 vvort 2015-02-01 06:00:01 UTC
More precise description of the problem:
Poppler library renders shaded fills as huge amount of small polygons.
Processing of such big amount of data takes very long time.
Comment 8 Commit Notification 2015-06-19 08:08:24 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e0f3e7c007e9eeced888b491ec2698acba4bc588

tdf#42374 some small optimisations for opening this PDF file

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2015-06-19 08:18:48 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1497dd974575d0d5de7e5b3ca4b5a97948318b5c

tdf#42374, improve perf by fixing bug in pdfi::HashedStyle::hashCode()

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2015-06-19 08:57:16 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4f1587965e85e09796c2074d90e9067337f2b710

tdf#42374 - read PDF in larger chunks

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Samuel Sieb 2016-06-09 20:08:28 UTC
I just tested the pdf from http://standards.ieee.org/getieee802/download/802.1AE-2006.pdf with V5.1.4 and it hasn't managed to finish loading after 20 minutes.  I took apart the pdf and found that it's page 43 that is the problem.  I suspect it's because there is some kind of patterned background in a diagram.  Is this the same issue or should I open a new bug?
Comment 12 vvort 2016-06-10 05:44:24 UTC
It is the same problem.
Background from page #43 is imported as 60000 tiny images.
Comment 13 QA Administrators 2017-10-26 08:09:51 UTC Comment hidden (obsolete)
Comment 14 jm 2017-10-26 11:31:44 UTC
Hello,

I test again with my ticket 50573 (same file) ; and it is not OK ; same thing : during opening wait, wait, wait and nothing

My version is 
Version: 5.4.2.2
Build ID: 22b09f6418e8c2d508a9eaf86b2399209b0990f4
Threads CPU : 4; OS : Windows 6.1; UI Render : par défaut; 
Locale : fr-FR (fr_FR); Calc: group
Comment 15 QA Administrators 2018-10-27 02:56:02 UTC Comment hidden (obsolete)
Comment 16 jm 2018-10-27 10:32:47 UTC
I test again with my ticket 50573 (same file) ; and it is not OK ; same thing : during opening wait, wait, wait and nothing

My version is 
Version: 6.0.6.2 (x64)
Build ID: 0c292870b25a325b5ed35f6b45599d2ea4458e77
Threads CPU : 4; OS : Windows 6.1; UI Render : par défaut; 
Locale : fr-FR (fr_FR); Calc: group
Comment 17 Richard Chen 2018-11-29 09:13:26 UTC
i just opened the file that caused you wait, and also got a same situation on my version of libreoffice

here's the info of version:

Version: 6.3.0.0.alpha0+ (x64)
Build ID: 0f25a3c36f27fd51453b9a9115f236b83c143684
CPU threads: 8; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-11-27_20:06:55
Locale: zh-TW (zh_TW); UI-Language: en-US
Calc: threaded
Comment 18 Xisco Faulí 2019-07-08 15:52:52 UTC
it takes

real	6m4,702s
user	5m59,987s
sys	0m1,586s

in

Version: 6.4.0.0.alpha0+
Build ID: 9b7729c6e224dfbe89e309aab8e8fd392fc234ad
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

Moving to NEW...
Comment 19 Xisco Faulí 2019-07-08 15:53:23 UTC
@Noel, I thought you could be interested in this issue...
Comment 20 Noel Grandin 2019-07-10 06:32:58 UTC
I am afraid this document is pathological. The pictures in it are not vector-format, nor are they bitmaps - they are "vector-format" with millions of tiny rectangles.

Somebody ran this document through a very bad converter.

About the only thing we could do would be to error out when detecting such PDFs.
Comment 21 m_a_riosv 2021-05-13 23:37:56 UTC
20 seconds to open with Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 5d7251c7121cee8885fa9f2387c4a0625dd4ecee
CPU threads: 4; OS: Windows 10.0 Build 21376; UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL

1m25s to open with Version: 7.1.3.2 (x64) / LibreOffice Community
Build ID: 47f78053abe362b9384784d31a6e56f8511eb1c1
CPU threads: 4; OS: Windows 10.0 Build 21376; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL

So seems working enough fine now.
Comment 22 Commit Notification 2021-05-15 09:22:24 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3669d4ec43a6aa2d410d8351d631548db45a5302

add OString::getTokenView (tdf#42374 related)

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.