Bug 246955 - print/cups-pdf: Update broke cups printing to pdfs. Removal of cups-pdf broke cups entirely.
Summary: print/cups-pdf: Update broke cups printing to pdfs. Removal of cups-pdf brok...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2020-06-03 12:55 UTC by James B. Byrne
Modified: 2020-06-17 01:49 UTC (History)
4 users (show)

See Also:
koobs: maintainer-feedback? (tijl)
koobs: merge-quarterly?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James B. Byrne 2020-06-03 12:55:41 UTC
FreeBSd-12.1-RELEASE-p5
cups-2.2.13
cups-filters-1.27.3
ghostscript9-agpl-base-9.52_1

Since removing the latest cups-pdf pkg the cupsd service is unable to print anything.  The following errors are reported in /var/log/cups/error_log for a single line text file printed from Pluma:

. . .
D [03/Jun/2020:08:41:11 -0400] [Job 1722] STATE: -connecting-to-device
D [03/Jun/2020:08:41:11 -0400] cupsdMarkDirty(---J-)
D [03/Jun/2020:08:41:11 -0400] cupsdSetBusyState: newbusy="Printing jobs and dirty files", busy="Dirty files"
D [03/Jun/2020:08:41:11 -0400] [Job 1722] np4172.hamilton.harte-lyne.ca=192.168.216.52
D [03/Jun/2020:08:41:11 -0400] [Job 1722] backendWaitLoop(snmp_fd=5, addr=0x801d08188, side_cb=0x1028140)
D [03/Jun/2020:08:41:11 -0400] [Job 1722] pdftops - copying to temp print file \"/var/spool/cups/tmp/0605d5ee337aa\"
D [03/Jun/2020:08:41:11 -0400] [Job 1722] pdftopdf: Last filter determined by the PPD: None; FINAL_CONTENT_TYPE: application/vnd.cups-postscript => pdftopdf will not log pages in page_log.
D [03/Jun/2020:08:41:11 -0400] [Job 1722] PDF interactive form and annotation flattening done via QPDF
D [03/Jun/2020:08:41:11 -0400] [Job 1722] Printer make and model: Lexmark Lexmark T630 Laser Printer
D [03/Jun/2020:08:41:11 -0400] [Job 1722] Running command line for pstops: pstops 1722 username \'Unsaved Document 2\' 1 \'JCLPortRotation=None JCLPictureGrade=PrtSet noLXCollate noOutputBin Resolution=300dpi InputSlot=AutoSelect Duplex=None JCLTonerDarkness=None PageSize=Letter MediaType=Plain job-uuid=urn:uuid:e3ddce36-fbfe-39c5-521b-399d99e2da35 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1591188071 time-at-processing=1591188071\'
D [03/Jun/2020:08:41:11 -0400] [Job 1722] Using image rendering resolution 300 dpi
D [03/Jun/2020:08:41:11 -0400] [Job 1722] Running command line for gs: gs -q -dNOPAUSE -dBATCH -dSAFER -dNOMEDIAATTRS -sstdout=%stderr -sDEVICE=ps2write -dShowAcroForm -sOUTPUTFILE=%stdout -sProcessColorModel=DeviceGray -sColorConversionStrategy=Gray -dLanguageLevel=3 -r300 -dCompressFonts=false -dNoT3CCITT -dNOINTERPOLATE -c \'save pop\' -f /var/spool/cups/tmp/0605d5ee337aa
D [03/Jun/2020:08:41:11 -0400] [Job 1722] Started filter gs (PID 24671)
D [03/Jun/2020:08:41:11 -0400] [Job 1722] Started filter pstops (PID 24672)
D [03/Jun/2020:08:41:11 -0400] Discarding unused printer-state-changed event...
D [03/Jun/2020:08:41:11 -0400] [Job 1722] While reading gs_ll3.ps:
D [03/Jun/2020:08:41:11 -0400] [Job 1722] Error: /undefinedresource in findresource
D [03/Jun/2020:08:41:11 -0400] [Job 1722] Operand stack:
D [03/Jun/2020:08:41:11 -0400] [Job 1722] true   (gs_icc.ps\\000gs_mex_e.ps\\000gs_mro_e.ps\\000gs_pdf_e.ps\\000gs_wan_e.ps\\000pdf_ops.ps\\000pdf_rbld.ps\\000pdf_base.ps\\000pdf_draw.ps\\000gs_cff.ps\\000gs_mgl_e.ps\\000gs_ttf.ps\\000pdf_font.ps\\000pdf_main.ps\\000pdf_sec.ps\\000gs_epsf.ps\\000gs_pdfwr.ps)   (gs_ll3.ps)   1   Pscript5Idiom.pkgsave   IdiomSet   7   Pscript5Idiom.pkgsave
D [03/Jun/2020:08:41:11 -0400] [Job 1722] Execution stack:
D [03/Jun/2020:08:41:11 -0400] [Job 1722] %interp_exit   --nostringval--   findresource   %loop_continue   findresource   findresource   findresource   false   1   %stopped_push   --nostringval--   1902   8   5   %oparray_pop   findresource   findresource   --dict:16/18(ro)(G)--   --dict:2/2(G)--   findresource   1   %dict_continue   findresource   findresource   1900   6   5   %oparray_pop   findresource   %errorexec_pop   findresource   findresource   findresource   findresource
D [03/Jun/2020:08:41:11 -0400] [Job 1722] Dictionary stack:
D [03/Jun/2020:08:41:11 -0400] [Job 1722] --dict:956/1123(G)--   --dict:0/20(G)--   --dict:77/200(L)--   --dict:956/1123(G)--   --dict:38/43(G)--   --dict:16/18(ro)(G)--
D [03/Jun/2020:08:41:11 -0400] [Job 1722] Current allocation mode is global
D [03/Jun/2020:08:41:11 -0400] [Job 1722] Current file position is 18941
D [03/Jun/2020:08:41:11 -0400] [Job 1722] The print file is empty.
D [03/Jun/2020:08:41:11 -0400] [Job 1722] PID 24672 (pstops) stopped with status 1!
D [03/Jun/2020:08:41:11 -0400] [Job 1722] PID 24671 (gs) stopped with status 1!
D [03/Jun/2020:08:41:11 -0400] [Job 1722] PID 24669 (/usr/local/libexec/cups/filter/pdftops) stopped with status 1.
D [03/Jun/2020:08:41:11 -0400] [Job 1722] PID 24670 (/usr/local/libexec/cups/backend/lpd) exited with no errors.
D [03/Jun/2020:08:41:11 -0400] Discarding unused job-state-changed event...
E [03/Jun/2020:08:41:11 -0400] [Job 1722] Job stopped due to filter errors; please consult the /var/log/cups/error_log file for details.
. . .
Comment 1 Li-Wen Hsu freebsd_committer 2020-06-16 06:17:57 UTC
CC the latest committer of print/cups and print/cups-pdf.
Comment 2 Mateusz Piotrowski freebsd_committer 2020-06-16 06:58:32 UTC
I'm sorry, I cannot help. I don't know much about print/cups-pdf.
Comment 3 Li-Wen Hsu freebsd_committer 2020-06-16 07:47:19 UTC
0mp: is it possible to check if this is caused by upgrading cups-pdf to 3.x?
Comment 4 Tijl Coosemans freebsd_committer 2020-06-16 08:14:13 UTC
(In reply to James B. Byrne from comment #0)
> ... Pscript5Idiom.pkgsave ...

When pkg has to install a file over an existing file it doesn't know about it keeps a copy of the original with a .pkgsave extension.  Since Pscript5Idiom is part of ghostscript, pkg should know about it so something must have gone wrong with previous package updates.

Search your system for .pkgsave files, see if you still need them and if not, delete them.
Comment 5 James B. Byrne 2020-06-16 19:03:29 UTC
This issue is the result of the switch to CUPS-PDF v3.   The work-around that was eventually discovered was to forcibly re-install all the components of the CUPS update from July 2019. Lock those packages. Then forcibly re-install all the current packages to the latest version. Finally, run autoremove. This cleared the issue for me.

The packages that I used were:

pkg add -f /var/cache/pkg/ghostscript9-agpl-base-9.27_2.txz
pkg add -f /var/cache/pkg/cups-2.2.11.txz
pkg add -f /var/cache/pkg/cups-filters-1.25.0.txz
pkg add -f /var/cache/pkg/cups-pdf-2.6.1_4.txz
pkg add -f /var/cache/pkg/qpdf-8.4.2.txz


There were more recent pkg updates available that predated the change to cups-pdf but these I was sure of.
Comment 6 James B. Byrne 2020-06-16 19:04:14 UTC
(In reply to Li-Wen Hsu from comment #3)

It is indeed the result of the switch to cups-pdf v3
Comment 7 Tatsuki Makino 2020-06-17 00:15:01 UTC
backtrace, I got it from cups-pdf-3.0.1.

(lldb) target create "/usr/local/libexec/cups/backend/cups-pdf" --core "/tmp/0.cups-pdf.0.core"
Core file '/tmp/0.cups-pdf.0.core' (x86_64) was loaded.
(lldb) bt
* thread #1, name = 'cups-pdf', stop reason = signal SIGSEGV
  * frame #0: 0x0000000000205c0c cups-pdf`init(argv=0x00007fffffffe7d8) at cups-pdf.c:377:27
    frame #1: 0x0000000000204442 cups-pdf`main(argc=6, argv=0x00007fffffffe7d8) at cups-pdf.c:839:7
    frame #2: 0x000000000020417f cups-pdf`_start + 255
Comment 8 Tatsuki Makino 2020-06-17 01:49:12 UTC
#define CP_CONFIG_PATH "/etc/cups" in cups-pdf-3.0.1/src/cups-pdf.h line 21 should be changed to ${ETCDIR}/cups.
But the post-configure target is not working.