OpenPrinting / OpenPrinting/libcupsfilters

Intermittent empty Apple Raster output from PDF filter chain causes Samsung SPL timeout

Open
#250 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
17
Forks
71
Avg merge
2d 17h
Merged PRs (30d)
13

Description

Description

Printing a valid PDF through a driverless IPP queue sometimes produces an
empty raster output although the filter chain exits successfully.

The Samsung printer then reports:

  SPL Error - Incomplete Session by time out

The same printer and IPP queue can print a pre-rendered image/urf file
successfully.

Environment
  • OS: Arch Linux
  • cups: 2.4.19-1
  • cups-filters: 2.0.1-3
  • libcupsfilters: 2.2.1-2
  • ghostscript: 10.08.0-1
  • Printer: Samsung Xpress M2825DW
  • Printer firmware/SPL: SPL 5.73.04 06-10-2014
  • Connection: driverless IPP over mDNS
  • Device URI:
    ipp://Samsung%20M2825DW%20(mDNS)._ipp._tcp.local/
  • Resolved URI:
    ipp://Samsung-Printer.local:631/ipp/print
Input document

The input PDF has three A4 pages:

Pages: 3
Page size: 595 x 842 pts (A4)

Failing filter chain

The queue uses:

application/pdf
-> pdftopdf
-> gstoraster / cfFilterGhostscript
-> image/urf
-> IPP backend

The relevant PPD path is:

/etc/cups/ppd/Samsung_M2825DW.ppd

The PPD selects Apple Raster/URF output:

Final data MIME type: image/urf
cfFilterGhostscript: Output format: Apple Raster

Observed error

In the failing CUPS job, the log contains:

cfFilterGhostscript: No pages left, outputting empty file.

Nevertheless, the filters and backend report success, and CUPS completes the
job. The printer subsequently prints:

SPL Error - Incomplete Session by time out
Position: 0x0 (0)
System: h6fwsim/os_hook
LINE: 1560
VERSION: SPL 5.73.04 06-10-2014

The position varies between attempts.

Control tests

Running the same conversion manually succeeds:

cupsfilter
-p /etc/cups/ppd/Samsung_M2825DW.ppd
-m image/urf
-o sides=one-sided
-o number-up=1
-o copies=1
'/tmp/Ihr Print@Home Ticket mit der Auftrags-Nr. 273238.pdf'
> /tmp/ausgabe-simplex.urf

Result:

Ghostscript exited with no errors.
gstoraster exited with no errors.
Output size: approximately 7.7 MiB

Sending the resulting URF file through the same CUPS queue succeeds:

lp -d Samsung_M2825DW
-o document-format=image/urf
/tmp/ausgabe-simplex.urf

The printer then prints all three pages correctly without an error page.

Therefore:

  • the PDF is valid;

  • the PDF-to-URF conversion can produce valid output;

  • the IPP backend and printer can successfully transfer and process the
    resulting URF file;

  • the failure appears specific to the scheduler-run PDF filter chain or its
    handling of an unexpectedly empty filter output.

Additional observation

During manual conversion, the log reported:

Processing page 1...
Processing page 2...
Processing page 3...
Processing page 4...

although both the original PDF and the intermediate PDF contain three pages.
The resulting URF file nevertheless prints three pages correctly.

Related issues

This appears related to:

  • #76 — successful exit status hiding a Ghostscript failure
  • cups-filters #117 — handling of zero-page jobs
  • #233 — No pages left, outputting empty file

However, this case does not use page-ranges, number-up > 1, or multiple
copies. The input PDF contains three pages and the failure is observed in the
PDF-to-Apple-Raster path.

Expected behavior

If a valid PDF contains pages, cfFilterGhostscript() should either:

  1. produce a valid Apple Raster output and return success; or
  2. return a filter error if no output was produced.

An empty output should not be passed to the printer as a successful job.

Actual behavior

The filter chain can log:

No pages left, outputting empty file.

while returning success. The empty/incomplete output is then sent to the
printer, which reports an SPL timeout.

Question

Could this be investigated in cfFilterGhostscript() or in the interaction
between cfFilterPDFToPDF()/pdftopdf and cfFilterGhostscript() when the
filters are run by the CUPS scheduler?

Attaching cups/error_log
The pdf file is a valid exhibition ticket within a few weeks. Therefor I don't want to upload it here into public space. I can send it via e-mail if needed or paste it here after expiration date.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached error_log.txt and the cfFilterGhostscript() and cfFilterPDFToPDF() entry points, comparing the scheduler-run chain with the manual cupsfilter result. Trace why a valid three-page PDF reaches “No pages left” and ensure an empty Apple Raster output cannot be sent as a successful job. Done means valid PDFs produce usable output or the filter reports an error instead.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.