Bug 1152720

Summary: EMU: ghostscript 9.27 breaks printing
Product: [openSUSE] openSUSE Distribution Reporter: Luigi Baldoni <aloisio>
Component: PrintingAssignee: Johannes Meixner <jsmeix>
Status: RESOLVED FIXED QA Contact: Johannes Meixner <jsmeix>
Severity: Normal    
Priority: P5 - None CC: davidjmurdoch, emu, forgotten_7645792743, henk.vanvelden, ismail, jdelvare, maint-coord, Manfred.Haertel, martin.wilck, me, tchvatal, vcizek, werner
Version: Leap 15.1   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
URL: https://paste.opensuse.org/52940726
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: cups LogLevel debug file
cups-filters-297cc2de.patch -- commit 297cc2decc53e0b08eb03049fce375db33df2131
cups-filters-1.20.3-2.3.1.x86_64.rpm

Description Luigi Baldoni 2019-10-01 17:55:02 UTC
Using a Brother HL-2030 with driver Foomatic/hl1250 on Leap 15.1/KDE. 
After updating ghostscript to 9.27 every job in the queue returns "filter failed".

The problem was resolved by reinstalling ghostscript/ghostscript-x11 9.26a-lp151.3.3.1.
Comment 1 Henk van Velden 2019-10-02 13:07:45 UTC
Same here on an USB connected HP Deskjet F4180 with HP Deskjet f4100 Series hpijs, 3.17.9.

Downgrading helps.
Comment 2 Henk van Velden 2019-10-02 13:17:37 UTC
It is probably somewhere here:

D [02/Oct/2019:12:35:12 +0200] [Job 115] GPL Ghostscript 9.27: Unrecoverable error, exit code 1
D [02/Oct/2019:12:35:12 +0200] [Job 115] Process is dying with \"Unable to determine number of pages, page count: -1
D [02/Oct/2019:12:35:12 +0200] [Job 115] \", exit stat 3
D [02/Oct/2019:12:35:12 +0200] [Job 115] Cleaning up...
Comment 3 Jean Delvare 2019-10-02 13:59:15 UTC
Same problem here on a HP LaserJet M1212nf. Downgrading worked around the problem. Adding Werner Fink who did the latest update.
Comment 4 Jean Delvare 2019-10-02 14:01:24 UTC
I am seeing the problem on both Leap 15.1 and SLED 12 SP4. I'm obviously available to provide debugging information or do more testing, I only need some guidance.
Comment 5 Luigi Baldoni 2019-10-02 14:47:34 UTC
Created attachment 820270 [details]
cups LogLevel debug file

Added log snippet.
Comment 6 Dr. Werner Fink 2019-10-02 15:39:50 UTC
I see this here frm log file

 bash> grep ^E Downloads/cups_gs927.log
 E [02/Oct/2019:16:35:36 +0200] Unable to open listen socket for address [v1.::1]:631 - Cannot assign requested address.
 E [02/Oct/2019:16:36:05 +0200] [CGI] cups-brf must be called as root
 E [02/Oct/2019:16:36:05 +0200] [cups-deviced] PID 20167 (cups-brf) stopped with status 1!
 E [02/Oct/2019:16:36:05 +0200] [cups-deviced] PID 20172 (gutenprint52+usb) stopped with status 1!
 E [02/Oct/2019:16:36:15 +0200] [Job 221] Job stopped due to filter errors; please consult the error_log file for details.

the question rises if this cause the messages also included in the log file and seen in comment#2
Comment 7 Luigi Baldoni 2019-10-02 16:16:30 UTC
> I see this here frm log file
> E [02/Oct/2019:16:35:36 +0200] Unable to open listen socket for address [v1.::1]:631 - Cannot assign requested address.
> E [02/Oct/2019:16:36:05 +0200] [CGI] cups-brf must be called as root
> E [02/Oct/2019:16:36:05 +0200] [cups-deviced] PID 20167 (cups-brf) stopped with status 1!
> E [02/Oct/2019:16:36:05 +0200] [cups-deviced] PID 20172 (gutenprint52+usb) stopped with status 1!

My /var/log/cups/error_log shows all of the above since at least June 2018.

> E [02/Oct/2019:16:36:15 +0200] [Job 221] Job stopped due to filter errors; please consult the error_log file for details.

This instead has appeared only since the 1st of October 2019 when gutenprint 9.27 was pushed (and before setting the loglevel to debug).
Comment 8 Martin Winter 2019-10-02 16:59:02 UTC
see also https://bugzilla.opensuse.org/show_bug.cgi?id=1131863#c7

Have the same problem here and https://bugzilla.opensuse.org/show_bug.cgi?id=1131863#c1 seems to have it seen coming...
Comment 9 Luigi Baldoni 2019-10-02 18:47:05 UTC
I see. I suppose the 9.27 update was rushed on account of the vulnerability.
Comment 10 David Murdoch 2019-10-02 22:28:09 UTC
Same issue on Leap 15.0 as Leap 15.1.

When previous ghostscript version 9.27-lp150.2.23.1 is installed to replace current version 9.26a-lp150.2.20.1 problem disappears.
Comment 11 Martin Winter 2019-10-03 06:26:02 UTC
(In reply to David Murdoch from comment #10)
> Same issue on Leap 15.0 as Leap 15.1.
> 
> When previous ghostscript version 9.27-lp150.2.23.1 is installed to replace
> current version 9.26a-lp150.2.20.1 problem disappears.

@David: By updating the version field in the bug you *updated* it to 15.0 instead of *adding* it. Unfortunately bugzilla does not allow to select multiple versions.

I changed it back to 15.1 as this is the most current version.
Comment 12 Dr. Werner Fink 2019-10-03 08:12:51 UTC
(In reply to Martin Winter from comment #8)
> see also https://bugzilla.opensuse.org/show_bug.cgi?id=1131863#c7
> 
> Have the same problem here and
> https://bugzilla.opensuse.org/show_bug.cgi?id=1131863#c1 seems to have it
> seen coming...

Ahh ... thanks for this point!!!

> As ghostscript 9.27 is now rolled-out on Leap 15.1, but cups-filters is still 
> on 1.20.3, printing is broken as already foreseen in comment #1. An update of 
> cups-filters is now absolutely necessary for Leap 15.1.

this indeed I didn't know. I had tested only ghostscript for working with all available ps/pdf files an various printer drivers including cups!

(In reply to Luigi Baldoni from comment #9)
> I see. I suppose the 9.27 update was rushed on account of the vulnerability.

sorry about, nevertheless I had tested ghostscript intensively but I simply had not known that versions of ghsotscript and cups-filters depend each other :(
Comment 13 Martin Winter 2019-10-03 09:34:39 UTC
I'm currently building qpdf-9.0.1 and cups-filters-1.25.0 for Leap 15.0 and 15.1 on my home project https://build.opensuse.org/project/show/home:letsfindaway. I just copypac'ed the packages from Leap 15.2 and they built without causing any further dependency. As soon as they are published in the repository I will test them and come back here to inform you about the results.

Perhaps backporting these packages from 15.2 could be an easy way to solve the problem.
Comment 14 Martin Winter 2019-10-03 09:38:34 UTC
Builds are just finished! I installed these packages and the problem was gone. So we should really go in that direction.

How could I trigger an official backport of those packages? What is the proper way to do this? Who should be contacted?
Comment 15 Jean Delvare 2019-10-03 10:50:38 UTC
Given that both packages are shared with SLE products, I guess the SUSE maintenance team should take care of that.

Maintenance team, we'd need a fast maintenance update of qpdf and cups-filters in SLE 15, SLE 15 SP1 as well as SLE 12 SP4, to fix the regression caused by the recent maintenance update of ghostscript.
Comment 16 Dr. Werner Fink 2019-10-04 06:41:09 UTC
I really wonder why both qpdf and cups-filters at build time do not depend on the version of libgs/ghostscript within the spec files.
Comment 17 Ismail Dönmez 2019-10-04 06:44:09 UTC
(In reply to Dr. Werner Fink from comment #16)
> I really wonder why both qpdf and cups-filters at build time do not depend
> on the version of libgs/ghostscript within the spec files.

qpdf does not use libgs/ghostscript etc, it's a pretty standalone library.
Comment 18 Dr. Werner Fink 2019-10-04 07:21:45 UTC
(In reply to Ismail Dönmez from comment #17)
> (In reply to Dr. Werner Fink from comment #16)
> > I really wonder why both qpdf and cups-filters at build time do not depend
> > on the version of libgs/ghostscript within the spec files.
> 
> qpdf does not use libgs/ghostscript etc, it's a pretty standalone library.

Hmm .. strange,  then I'd like to know why Martin dies have qpdf on his list ... beside cups-filters
Comment 19 Dr. Werner Fink 2019-10-04 07:36:20 UTC
In cups-filters-1.25.0/INSTALL I found

 **** IF YOU HAVE A NON-POSTSCRIPT PRINTER AND ARE NOT       ****
 **** RUNNING MAC OS X, YOU WILL ALSO NEED TO INSTALL GPL    ****
 **** GHOSTSCRIPT WITH THE "cups" DRIVER AFTER YOU INSTALL   ****
 **** CUPS AND BEFORE YOU INSTALL THIS PACKAGE.              ****

and in cups-filters-1.25.0/NEWS

CHANGES IN V1.22.5

        - foomatic-rip: Changed Ghostscript call to count pages in a
          PDF file to use "runpdfbegin" and not the undocumented
          Ghostscript internal "pdfdict", so that it works with
          Ghostscript 9.27 and later (Debian bug #926576, Arch Linux
          bug #62251).

... that seems to cause the trouble

 ``undocumented Ghostscript internal "pdfdict"''
Comment 20 Dr. Werner Fink 2019-10-04 08:14:10 UTC
Created attachment 820501 [details]
cups-filters-297cc2de.patch -- commit 297cc2decc53e0b08eb03049fce375db33df2131

(In reply to Dr. Werner Fink from comment #19)
> In cups-filters-1.25.0/INSTALL I found
> 
>  **** IF YOU HAVE A NON-POSTSCRIPT PRINTER AND ARE NOT       ****
>  **** RUNNING MAC OS X, YOU WILL ALSO NEED TO INSTALL GPL    ****
>  **** GHOSTSCRIPT WITH THE "cups" DRIVER AFTER YOU INSTALL   ****
>  **** CUPS AND BEFORE YOU INSTALL THIS PACKAGE.              ****
> 
> and in cups-filters-1.25.0/NEWS
> 
> CHANGES IN V1.22.5
> 
>         - foomatic-rip: Changed Ghostscript call to count pages in a
>           PDF file to use "runpdfbegin" and not the undocumented
>           Ghostscript internal "pdfdict", so that it works with
>           Ghostscript 9.27 and later (Debian bug #926576, Arch Linux
>           bug #62251).
> 
> ... that seems to cause the trouble
> 
>  ``undocumented Ghostscript internal "pdfdict"''

This seems the relevant part of cups-filters to get working cups back with ghostscript 9.27
Comment 21 Dr. Werner Fink 2019-10-04 08:38:41 UTC
SLE-15-SP2 is with latest cups-filters ... for SLE-12, SLE-12-SP3, and SLE-15 (which is also Leap 15.0 and Leap 15.1) I've added the commit as a patch and submitted this.  Clearly this should be tested as well
Comment 22 Martin Winter 2019-10-04 09:00:09 UTC
(In reply to Dr. Werner Fink from comment #16)
> I really wonder why both qpdf and cups-filters at build time do not depend
> on the version of libgs/ghostscript within the spec files.

qpdf is on my list for a BuildRequires of cups-filters-1.25:

BuildRequires:  qpdf-devel >= 8.3.0

So it is not a runtime requirement but a build requirement. Anyway, when I install cups-filters-1.25, then also libqpdf.so.26 is required at runtime.
Comment 23 Martin Winter 2019-10-04 09:05:54 UTC
(In reply to Martin Winter from comment #22)
> (In reply to Dr. Werner Fink from comment #16)
> > I really wonder why both qpdf and cups-filters at build time do not depend
> > on the version of libgs/ghostscript within the spec files.
> 
> qpdf is on my list for a BuildRequires of cups-filters-1.25:
> 
> BuildRequires:  qpdf-devel >= 8.3.0
> 
> So it is not a runtime requirement but a build requirement. Anyway, when I
> install cups-filters-1.25, then also libqpdf.so.26 is required at runtime.

... and if you look at build.o.o https://build.opensuse.org/package/show/Printing/cups-filters you see that the builds for 15.0 and 15.1 fail because of a missing build dependency to qpdf-devel >= 8.3.0. That's why I also copied qpdf to my home project to resolve this dependency.
Comment 25 Luigi Baldoni 2019-10-04 09:25:05 UTC
Dr. Werner Fink wrote:
> SLE-15-SP2 is with latest cups-filters ... for SLE-12, SLE-12-SP3, and SLE-15 (which is also Leap 15.0 and Leap 15.1) I've added the commit as a patch and submitted this.  Clearly this should be tested as well

Gladly. Is there a package somewhere or should I add that patch on my own?
Comment 26 Dr. Werner Fink 2019-10-04 10:24:33 UTC
Created attachment 820533 [details]
cups-filters-1.20.3-2.3.1.x86_64.rpm

(In reply to Luigi Baldoni from comment #25)
> Dr. Werner Fink wrote:
> > SLE-15-SP2 is with latest cups-filters ... for SLE-12, SLE-12-SP3, and SLE-15 (which is also Leap 15.0 and Leap 15.1) I've added the commit as a patch and submitted this.  Clearly this should be tested as well
> 
> Gladly. Is there a package somewhere or should I add that patch on my own?

From internal build server ... I guess no ... nevertheless the build has provided for SUSE_SLE-15_Update/x86_64 the attached rpm.
Comment 28 Luigi Baldoni 2019-10-04 12:32:42 UTC
> From internal build server ... I guess no ... nevertheless the build has provided for SUSE_SLE-15_Update/x86_64 the attached rpm.

Appears to be working for me.
Comment 29 Dr. Werner Fink 2019-10-04 12:48:10 UTC
(In reply to Luigi Baldoni from comment #28)
> > From internal build server ... I guess no ... nevertheless the build has provided for SUSE_SLE-15_Update/x86_64 the attached rpm.
> 
> Appears to be working for me.

Thanks a lot for this feedback!
Comment 30 Martin Winter 2019-10-04 13:41:41 UTC
clear needinfo request, hope I supplied enough info in #22 and #23
Comment 31 Swamp Workflow Management 2019-10-07 16:12:05 UTC
SUSE-RU-2019:2567-1: An update that has one recommended fix can now be installed.

Category: recommended (important)
Bug References: 1152720
CVE References: 
Sources used:
SUSE OpenStack Cloud Crowbar 8 (src):    cups-filters-1.0.58-19.5.1
SUSE OpenStack Cloud 8 (src):    cups-filters-1.0.58-19.5.1
SUSE Linux Enterprise Server for SAP 12-SP3 (src):    cups-filters-1.0.58-19.5.1
SUSE Linux Enterprise Server 12-SP5 (src):    cups-filters-1.0.58-19.5.1
SUSE Linux Enterprise Server 12-SP4 (src):    cups-filters-1.0.58-19.5.1
SUSE Linux Enterprise Server 12-SP3-LTSS (src):    cups-filters-1.0.58-19.5.1
SUSE Linux Enterprise Server 12-SP3-BCL (src):    cups-filters-1.0.58-19.5.1
SUSE Linux Enterprise Desktop 12-SP5 (src):    cups-filters-1.0.58-19.5.1
SUSE Linux Enterprise Desktop 12-SP4 (src):    cups-filters-1.0.58-19.5.1
SUSE Enterprise Storage 5 (src):    cups-filters-1.0.58-19.5.1
HPE Helion Openstack 8 (src):    cups-filters-1.0.58-19.5.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 32 Swamp Workflow Management 2019-10-07 16:13:32 UTC
SUSE-RU-2019:2566-1: An update that has one recommended fix can now be installed.

Category: recommended (important)
Bug References: 1152720
CVE References: 
Sources used:
SUSE OpenStack Cloud 7 (src):    cups-filters-1.0.58-15.5.1
SUSE Linux Enterprise Server for SAP 12-SP2 (src):    cups-filters-1.0.58-15.5.1
SUSE Linux Enterprise Server for SAP 12-SP1 (src):    cups-filters-1.0.58-15.5.1
SUSE Linux Enterprise Server 12-SP2-LTSS (src):    cups-filters-1.0.58-15.5.1
SUSE Linux Enterprise Server 12-SP2-BCL (src):    cups-filters-1.0.58-15.5.1
SUSE Linux Enterprise Server 12-SP1-LTSS (src):    cups-filters-1.0.58-15.5.1
SUSE Enterprise Storage 4 (src):    cups-filters-1.0.58-15.5.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 33 Vítězslav Čížek 2019-10-07 17:25:16 UTC
The SLE Updates were released, Leap will follow shortly.
Comment 34 Swamp Workflow Management 2019-10-07 22:11:45 UTC
SUSE-RU-2019:2568-1: An update that has one recommended fix can now be installed.

Category: recommended (important)
Bug References: 1152720
CVE References: 
Sources used:
SUSE Linux Enterprise Module for Basesystem 15-SP1 (src):    cups-filters-1.20.3-3.3.1
SUSE Linux Enterprise Module for Basesystem 15 (src):    cups-filters-1.20.3-3.3.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 35 Swamp Workflow Management 2019-10-09 19:12:29 UTC
openSUSE-RU-2019:2301-1: An update that has one recommended fix can now be installed.

Category: recommended (important)
Bug References: 1152720
CVE References: 
Sources used:
openSUSE Leap 15.0 (src):    cups-filters-1.20.3-lp150.2.3.1
Comment 36 Swamp Workflow Management 2019-10-09 19:16:31 UTC
openSUSE-RU-2019:2302-1: An update that has one recommended fix can now be installed.

Category: recommended (important)
Bug References: 1152720
CVE References: 
Sources used:
openSUSE Leap 15.1 (src):    cups-filters-1.20.3-lp151.3.3.1
Comment 37 Johannes Meixner 2020-11-19 07:09:35 UTC
*** Bug 1131771 has been marked as a duplicate of this bug. ***