Bug 1628255

Summary: cups-filters: Sticky EOF behavior in glibc breaks descriptor concatenation using dup2 (breaks printing)
Product: [Fedora] Fedora Reporter: Zdenek Dohnal <zdohnal>
Component: cups-filtersAssignee: Zdenek Dohnal <zdohnal>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: aoliva, arjun, awilliam, codonell, debarshir, dj, fweimer, gmarr, jeischma, jpopelka, kparal, law, mfabian, mkasik, pfrankli, robatino, rth, siddhesh, twaugh, zdohnal
Target Milestone: ---Keywords: CommonBugs
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: RejectedBlocker https://fedoraproject.org/wiki/Common_F29_bugs#cups-filters-fail
Fixed In Version: cups-filters-1.20.3-9.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-02 19:31:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1626996    
Attachments:
Description Flags
Bad strace
none
Good strace none

Description Zdenek Dohnal 2018-09-12 14:59:01 UTC
Created attachment 1482708 [details]
Bad strace

Printing stopped working with several filters (f.e. foomatic-rip) after glibc update to 2.27.9000-10. Print jobs get stuck in print queue as pending-held.

The problem is caused by upstream commit https://sourceware.org/git/?p=glibc.git;a=commit;h=2cc7bad0ae0a412e75270be5ed41d45c03e7a931 - which made EOF sticky, but it changed pipe concatenation behavior, which broke printing filters at least.

Steps to reproduce:
0) install cups and foomatic
1) Add 'FileDevice Yes' into /etc/cups/cups-files.conf
2) $ sudo systemctl restart cups
3) $ sudo lpadmin -p test -v file:/tmp/printout -m foomatic:Canon-imageRunner_C5185i-Postscript.ppd -E
4) $ lp -d test /etc/fstab
5) '$ lpstat -o test' produces an output - there is pending job

Comment 1 Zdenek Dohnal 2018-09-12 15:00:22 UTC
Created attachment 1482709 [details]
Good strace

Comment 2 Fedora Blocker Bugs Application 2018-09-14 11:51:23 UTC
Proposed as a Blocker for 29-final by Fedora user eischmann using the blocker tracking app because:

 This bug breaks printing over network for many printers, thus have a big impact on users.
To reproduce it, you need to set up a network printer the default way via printers panel in GNOME Control Center. It doesn't affect cups-browsed.

Comment 3 Zdenek Dohnal 2018-09-14 12:21:36 UTC
To be precise, 
1) it can be reproduced even by creating the printer by lpadmin (with any device uri, even file device uri), through CUPS web interface and system-config-printer. Essential part for reproducing is to have file which needs to be run through filters before it is send to printer. This can be done by creating a printer with ppd.

2) printing from client through print queues discovered by cups-browsed will not work if server, which shares printers, is F29+ (or if it has glibc-2.28 or backported patch mentioned above), because filtering is affected.

Cups-browsed uses design in which it sends unfiltered data to server, where filtering happens. So if server is affected by this issue, then printing through cups-browsed queues is no-go too.

Only other way to avoid this issue is send the print data to a printer as unfiltered, e.g. raw. But this is unrecommended and shouldn't be used for other purposes than debugging.

$ lp -d <printer> -o raw <file>

Comment 4 Geoffrey Marr 2018-09-17 20:16:07 UTC
Discussed during the 2018-09-17 blocker review meeting: [1]

The decision to classify this bug as a "RejectedBlocker" was made as this is obviously an annoying bug for some, but the release criteria don't cover printing in any way and therefore this bug cannot be classified as a blocker.

[1] https://meetbot.fedoraproject.org/fedora-blocker-review/2018-09-17/f29-blocker-review.2018-09-17-16.02.txt

Comment 6 Kamil Páral 2018-09-20 12:48:10 UTC
Geof, when you reject a high-profile annoying bug, please make sure it's at least tagged as a common bug. Thanks. Adding it now.

Comment 7 Florian Weimer 2018-09-21 09:56:09 UTC
glibc upstream will not revert this change and suggests that cups-filters should be fixed instead.  Reassigning accordingly.

Comment 8 Fedora Update System 2018-09-21 12:47:01 UTC
cups-filters-1.20.3-8.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-4f7176aa5c

Comment 9 Fedora Update System 2018-09-22 20:03:55 UTC
cups-filters-1.20.3-8.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-4f7176aa5c

Comment 10 Fedora Update System 2018-09-24 15:00:44 UTC
cups-filters-1.20.3-9.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-26b38a126f

Comment 11 Fedora Update System 2018-09-27 02:09:23 UTC
cups-filters-1.20.3-9.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-26b38a126f

Comment 12 Fedora Update System 2018-10-02 19:31:37 UTC
cups-filters-1.20.3-9.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.