Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 939607 - net-print/cups fails with >=x11-libs/cairo-1.18.2: "cfFilterPDFToPDF: load_file failed: temp file: unable to find trailer dictionary while recovering damaged file"
Summary: net-print/cups fails with >=x11-libs/cairo-1.18.2: "cfFilterPDFToPDF: load_fi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Printing Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2024-09-14 08:40 UTC by Markus Walter
Modified: 2024-09-18 03:45 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge--info.txt,10.90 KB, text/plain)
2024-09-14 08:41 UTC, Markus Walter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Walter 2024-09-14 08:40:49 UTC
On my ~amd64 machine printing stopped working after a recent upgrade and downgrading cairo to 1.18.0 fixed the problem.

I got a hint from https://bbs.archlinux.org/viewtopic.php?id=299255 that cairo may be involved.

Reproducible: Always
Comment 1 Markus Walter 2024-09-14 08:41:30 UTC
Created attachment 902966 [details]
emerge --info
Comment 2 Markus Walter 2024-09-14 08:43:54 UTC
Relevant output from cups error_log:

D [14/Sep/2024:10:16:46 +0200] [Job 345] cfFilterChain: ghostscript (PID 19564) started.
D [14/Sep/2024:10:16:46 +0200] [Job 345] Set job-printer-state-message to "cfFilterChain: ghostscript (PID 19564) started.", current level=INFO
D [14/Sep/2024:10:16:46 +0200] [Job 345] WARNING: cfFilterGhostscript: Output format: CUPS Rastertemp file: file is damaged
D [14/Sep/2024:10:16:46 +0200] [Job 345] Set job-printer-state-message to "temp file: can\'t find startxref", current level=WARN
D [14/Sep/2024:10:16:46 +0200] [Job 345] Set job-printer-state-message to "temp file: Attempting to reconstruct cross-reference table", current level=WARN
D [14/Sep/2024:10:16:46 +0200] [Job 345] cfFilterGhostscript: Copying input to temp file \"/var/spool/cups/tmp/04c6c66f06cc6\"
D [14/Sep/2024:10:16:46 +0200] [Job 345] Set job-printer-state-message to "temp file (object 12 0, offset 14742): EOF after endobj", current level=WARN
D [14/Sep/2024:10:16:46 +0200] [Job 345] Set job-printer-state-message to "temp file (object 12 0, offset 14596): stream dictionary lacks /Length key", current level=WARN
D [14/Sep/2024:10:16:46 +0200] [Job 345] Set job-printer-state-message to "temp file (object 12 0, offset 14686): attempting to recover stream length", current level=WARN
D [14/Sep/2024:10:16:46 +0200] [Job 345] Set job-printer-state-message to "temp file (object 12 0, offset 14686): recovered stream length: 17", current level=WARN
D [14/Sep/2024:10:16:46 +0200] [Job 345] Set job-printer-state-message to "cfFilterPDFToPDF: load_file failed: temp file: unable to find trailer dictionary while recovering damaged file", current level=ERROR
D [14/Sep/2024:10:16:46 +0200] [Job 345] cfFilterChain: pdftopdf completed with status 1.
D [14/Sep/2024:10:16:46 +0200] [Job 345] cfFilterGhostscript: Input is empty, outputting empty file.
Comment 3 Nathan Zachary 2024-09-18 02:59:09 UTC
I have also hit this bug.  Downgrading from =x11-libs/cairo-1.18.2 back to =x11-libs/cairo-1.18.0 and then restarting cupsd fixes the problem.  I have tested printing from Evince.
Comment 5 Nathan Zachary 2024-09-18 03:21:07 UTC
(In reply to Sam James from comment #4)
> Please try
> https://gitlab.freedesktop.org/cairo/cairo/-/commit/
> f19e2fe080ddcfce93c8234a919fd882f3d63362 applied to cairo.

Hello Sam,

Applying this patch to =x11-libs/cairo-1.18.2 and then restarting cupsd fixes the problem for me.  Thank you for your prompt reply.

Cheers,
Nathan Zachary
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-18 03:26:38 UTC
Thanks! I'll add it shortly.
Comment 7 Larry the Git Cow gentoo-dev 2024-09-18 03:45:21 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1013e397bc7000b42a9c2a185b6a1d92e4509d1d

commit 1013e397bc7000b42a9c2a185b6a1d92e4509d1d
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-09-18 03:44:53 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-09-18 03:44:53 +0000

    x11-libs/cairo: fix cups compat
    
    Closes: https://bugs.gentoo.org/939607
    Signed-off-by: Sam James <sam@gentoo.org>

 x11-libs/cairo/cairo-1.18.2-r1.ebuild        | 96 ++++++++++++++++++++++++++++
 x11-libs/cairo/files/cairo-1.18.2-cups.patch | 32 ++++++++++
 2 files changed, 128 insertions(+)