#1060057 printer-driver-cups-pdf: produces empty output with gs exit 256, gs from log works

Package:
printer-driver-cups-pdf
Source:
printer-driver-cups-pdf
Description:
printer driver for PDF writing via CUPS
Submitter:
наб
Date:
2025-03-29 08:45:02 UTC
Severity:
normal
Tags:
#1060057#5
Date:
2024-01-05 12:11:09 UTC
From:
To:
Dear Maintainer,

Runing lp -dPDF all.ps
(http://www.oldlinux.org/Linux.old/Ref-docs/POSIX/all.ps)
produces a blank one-page PDF and the following in
/var/log/cups/cups-pdf-PDF_log:
-- >8 --
Fri Jan  5 13:01:04 2024  [DEBUG] *** Final Configuration ***
Fri Jan  5 13:01:04 2024  [DEBUG] AnonDirName        = "/var/spool/cups-pdf/ANONYMOUS"
Fri Jan  5 13:01:04 2024  [DEBUG] AnonUser           = "nobody"
Fri Jan  5 13:01:04 2024  [DEBUG] GhostScript        = "/usr/bin/gs"
Fri Jan  5 13:01:04 2024  [DEBUG] GSCall             = "%s -q -dCompatibilityLevel=%s -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="%s" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c -f %s"
Fri Jan  5 13:01:04 2024  [DEBUG] Grp                = "lpadmin"
Fri Jan  5 13:01:04 2024  [DEBUG] GSTmp              = "TMPDIR=/var/tmp"
Fri Jan  5 13:01:04 2024  [DEBUG] Log                = "/var/log/cups"
Fri Jan  5 13:01:04 2024  [DEBUG] PDFVer             = "1.2"
Fri Jan  5 13:01:04 2024  [DEBUG] PostProcessing     = ""
Fri Jan  5 13:01:04 2024  [DEBUG] Out                = "${HOME}/PDF"
Fri Jan  5 13:01:04 2024  [DEBUG] Spool              = "/var/spool/cups-pdf/SPOOL"
Fri Jan  5 13:01:04 2024  [DEBUG] UserPrefix         = ""
Fri Jan  5 13:01:04 2024  [DEBUG] RemovePrefix       = ""
Fri Jan  5 13:01:04 2024  [DEBUG] OutExtension       = "pdf"
Fri Jan  5 13:01:04 2024  [DEBUG] Cut                = 3
Fri Jan  5 13:01:04 2024  [DEBUG] Truncate           = 64
Fri Jan  5 13:01:04 2024  [DEBUG] DirPrefix          = 0
Fri Jan  5 13:01:04 2024  [DEBUG] Label              = 1
Fri Jan  5 13:01:04 2024  [DEBUG] LogType            = 7
Fri Jan  5 13:01:04 2024  [DEBUG] LowerCase          = 1
Fri Jan  5 13:01:04 2024  [DEBUG] TitlePref          = 0
Fri Jan  5 13:01:04 2024  [DEBUG] DecodeHexStrings   = 1
Fri Jan  5 13:01:04 2024  [DEBUG] FixNewlines        = 0
Fri Jan  5 13:01:04 2024  [DEBUG] AllowUnsafeOptions = 0
Fri Jan  5 13:01:04 2024  [DEBUG] AnonUMask          = 0000
Fri Jan  5 13:01:04 2024  [DEBUG] UserUMask          = 0077
Fri Jan  5 13:01:04 2024  [DEBUG] *** End of Configuration ***
Fri Jan  5 13:01:04 2024  [DEBUG] set new gid: lpadmin
Fri Jan  5 13:01:04 2024  [DEBUG] initialization finished: v3.0.1
Fri Jan  5 13:01:04 2024  [DEBUG] user identified: nabijaczleweli
Fri Jan  5 13:01:04 2024  [DEBUG] output directory name generated: /home/nabijaczleweli/PDF
Fri Jan  5 13:01:04 2024  [DEBUG] user information prepared
Fri Jan  5 13:01:04 2024  [DEBUG] spoolfile name created: /var/spool/cups-pdf/SPOOL/cups2pdf-2243
Fri Jan  5 13:01:04 2024  [DEBUG] source stream ready
Fri Jan  5 13:01:04 2024  [DEBUG] destination stream ready: /var/spool/cups-pdf/SPOOL/cups2pdf-2243
Fri Jan  5 13:01:04 2024  [DEBUG] owner set for spoolfile: /var/spool/cups-pdf/SPOOL/cups2pdf-2243
Fri Jan  5 13:01:04 2024  [DEBUG] using traditional fgets
Fri Jan  5 13:01:04 2024  [DEBUG] found beginning of postscript code: %!PS-Adobe-3.0

Fri Jan  5 13:01:04 2024  [DEBUG] now extracting postscript code
Fri Jan  5 13:01:04 2024  [DEBUG] found title in ps code: stdin
nabijaczleweli/PDF
Fri Jan  5 13:01:04 2024  [DEBUG] found end of postscript code: %%EOF

Fri Jan  5 13:01:04 2024  [DEBUG] all data written to spoolfile: /var/spool/cups-pdf/SPOOL/cups2pdf-2243
Fri Jan  5 13:01:04 2024  [DEBUG] trying to use PS title: stdin
nabijaczleweli/PDF
Fri Jan  5 13:01:04 2024  [STATUS] ***Experimental Option: DecodeHexStrings
Fri Jan  5 13:01:04 2024  [DEBUG] checking for hex strings: stdin
nabijaczleweli/PDF
Fri Jan  5 13:01:04 2024  [DEBUG] not a hex string, has no start marker: stdin
nabijaczleweli/PDF
Fri Jan  5 13:01:04 2024  [DEBUG] calling alternate_replace_string
Fri Jan  5 13:01:04 2024  [DEBUG] removing alternate special characters from title: stdin
nabijaczleweli/PDF
Fri Jan  5 13:01:04 2024  [DEBUG] title successfully retrieved: job_67-stdin_nabijaczleweli_PDF
Fri Jan  5 13:01:04 2024  [DEBUG] input data read from stdin
Fri Jan  5 13:01:04 2024  [DEBUG] output filename created: /home/nabijaczleweli/PDF/job_67-stdin_nabijaczleweli_PDF.pdf
Fri Jan  5 13:01:04 2024  [DEBUG] ghostscript commandline built: /usr/bin/gs -q -dCompatibilityLevel=1.2 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="/home/nabijaczleweli/PDF/job_67-stdin_nabijaczleweli_PDF.pdf" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c -f /var/spool/cups-pdf/SPOOL/cups2pdf-2243
Fri Jan  5 13:01:04 2024  [DEBUG] output file unlinked: /home/nabijaczleweli/PDF/job_67-stdin_nabijaczleweli_PDF.pdf
Fri Jan  5 13:01:04 2024  [DEBUG] TMPDIR set for GhostScript: /var/tmp
Fri Jan  5 13:01:04 2024  [DEBUG] waiting for child to exit
Fri Jan  5 13:01:04 2024  [DEBUG] entering child process
Fri Jan  5 13:01:04 2024  [DEBUG] GID set for current user
Fri Jan  5 13:01:04 2024  [DEBUG] supplementary groups set for current user
Fri Jan  5 13:01:04 2024  [DEBUG] UID set for current user: nabijaczleweli
Fri Jan  5 13:01:04 2024  [DEBUG] ghostscript has finished: 256
Fri Jan  5 13:01:04 2024  [DEBUG] file mode set for user output: /home/nabijaczleweli/PDF/job_67-stdin_nabijaczleweli_PDF.pdf
Fri Jan  5 13:01:04 2024  [DEBUG] no postprocessing
Fri Jan  5 13:01:04 2024  [DEBUG] spoolfile unlinked: /var/spool/cups-pdf/SPOOL/cups2pdf-2243
Fri Jan  5 13:01:04 2024  [DEBUG] all memory has been freed
Fri Jan  5 13:01:04 2024  [STATUS] PDF creation successfully finished for nabijaczleweli
-- >8 --

Naturally, the filename and the contents are wrong.

Running
  gs -q -dCompatibilityLevel=1.2 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="tstout.pdf" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c -f all.ps
produces a working file.

This is a repost of #990210, per request
(which also implied that link is dead, which it isn't,
 but this is why I'm attaching a big file).

#1060057#10
Date:
2024-01-17 13:28:35 UTC
From:
To:
Dear maintainer,

I've prepared an NMU for lirc (versioned as 0.10.2-0.5) and
uploaded it1060093@bugs.debian.org.

Regards.

Gianfranco

#1060057#15
Date:
2025-03-08 08:44:05 UTC
From:
To:
Hey,

As we're approaching the freeze, I'm reviewing pending bugs.

I still cannot reproduce this.

Btw, the previous bug you referenced was due to CUPS-PDF's outdated
Ghostscript recipe. That has been fixed with a patch. The above bug
seems to be an entirely different issue.

Martin-Éric

#1060057#20
Date:
2025-03-08 16:01:19 UTC
From:
To:
I just explicitly updated cups-pdf cups ghostscript on sid and
  lp -dPDF all.ps
still produced an empty file (attached).

CUPS config attached, log below.

$ dpkg -l | grep -e cups -e pdf -e ghost
ii  cups                       2.4.10-2+b1        amd64 Common UNIX Printing System(tm) - PPD/driver support, web interface
ii  cups-client                2.4.10-2+b1        amd64  Common UNIX Printing System(tm) - client programs (SysV)
ii  cups-common                2.4.10-2           all    Common UNIX Printing System(tm) - common files
ii  cups-core-drivers          2.4.10-2+b1        amd64  Common UNIX Printing System(tm) - driverless printing
ii  cups-daemon                2.4.10-2+b1        amd64  Common UNIX Printing System(tm) - daemon
ii  cups-filters               1.28.17-4.1        amd64  OpenPrinting CUPS Filters - Main Package
ii  cups-filters-core-drivers  1.28.17-4.1        amd64  OpenPrinting CUPS Filters - Driverless printing
ii  cups-ipp-utils             2.4.10-2+b1        amd64  Common UNIX Printing System(tm) - IPP developer/admin utilities
ii  cups-ppdc                  2.4.10-2+b1        amd64  Common UNIX Printing System(tm) - PPD manipulation utilities
ii  cups-server-common         2.4.10-2           all    Common UNIX Printing System(tm) - server common files
ii  ghostscript                10.04.0~dfsg-2+b1  amd64  interpreter for the PostScript language and for PDF
ii  libcups2t64:amd64          2.4.10-2+b1        amd64  Common UNIX Printing System(tm) - Core library
ii  libcupsfilters1t64:amd64   1.28.17-4.1        amd64  OpenPrinting CUPS Filters - Shared library
ii  libqpdf29t64:amd64         11.9.1-1           amd64  runtime library for PDF transformation/inspection software
ii  printer-driver-cups-pdf    3.0.1-19           amd64  printer driver for PDF writing via CUPS

#1060057#25
Date:
2025-03-08 17:10:40 UTC
From:
To:
la 8.3.2025 klo 18.03 наб (nabijaczleweli@nabijaczleweli.xyz) kirjoitti:

Can I get a copy of that PS file?

Also, can you try another thing for me?

cat .bashrc | lp -dPDF

Does that produce a readable PDF for you? (I don't need a copy - I'm
just trying to see whether we might be having problems with converting
PS specifically).

Martin-Éric

#1060057#30
Date:
2025-03-08 17:28:30 UTC
From:
To:
It's attached to the OP on this bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1060057;filename=all.ps.zst;msg=5
The vast majority of postscripts, and all text files, work,
and I use cups-pdf basically all the time in my workflow.

Both of
  cat .bashrc | lp -dPDF
  curl https://lfs.nabijaczleweli.xyz/0012-groff-mdoc-*q-spacing/2022-10-23-stty.1-preprint/a4.ps | lp -dPDF
work, as expected, on bookworm and sid.

It's just this
(and some other similarly(?)-broken(?)/-funnily-configured(?))
document.

#1060057#35
Date:
2025-03-08 17:48:01 UTC
From:
To:
la 8.3.2025 klo 19.28 наб (nabijaczleweli@nabijaczleweli.xyz) kirjoitti:

Noted.

That's already more encouraging.

So we're dealing with a handful of corner-case PS files that, for
whatever odd reason, fail to convert. That's a lot harder to debug.
Let's see if upstream (in CC) might have any idea.

Martin-Éric