Bug 64967 - pdfinfo hangs when a corrupt file is piped in via stdin
Summary: pdfinfo hangs when a corrupt file is piped in via stdin
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: utils (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Mac OS X (All)
: medium major
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-24 21:41 UTC by Nathan Peck
Modified: 2013-05-27 22:34 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
A bad PDF file (91.17 KB, text/plain)
2013-05-24 21:41 UTC, Nathan Peck
Details

Description Nathan Peck 2013-05-24 21:41:52 UTC
Created attachment 79774 [details]
A bad PDF file

When pdfinfo receives a corrupt file that is piped in via stdin it hangs with 100% CPU usage.

Example Usage:

cat damaged.pdf | pdfinfo -

Output:

Syntax Warning: May not be a PDF file (continuing anyway)

Expected outcome:

The program should terminate after determining that the file is corrupt

Actual outcome:

After outputting the one error message it never terminates and sits there using 100% of the CPU.

It is worth noting that when pdfinfo is invoked with the exact same file via:

pdfinfo damaged.pdf

instead of piping the corrupt PDF in via stdin then this problem does not happen and the output is:

Syntax Warning: May not be a PDF file (continuing anyway)
Syntax Error: Couldn't find trailer dictionary
Syntax Error: Couldn't read xref table

Then the process terminates as expected.

I have attached the bad file that I am using to test with and recreate this issue.
Comment 1 Albert Astals Cid 2013-05-26 22:21:01 UTC
Will be fixed in poppler 0.22.5. Thanks for the report


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.