Wednesday, September 25, 2024

graphics/cairo: Printing regression

W [24/Sep/2024:20:36:51 -0400] [Job 8] temp file: file is damaged
W [24/Sep/2024:20:36:51 -0400] [Job 8] temp file: can\'t find startxref
W [24/Sep/2024:20:36:51 -0400] [Job 8] temp file: Attempting to reconstruct cross-reference table
W [24/Sep/2024:20:36:51 -0400] [Job 8] temp file (object 90 0, offset 1017080): EOF after endobj
W [24/Sep/2024:20:36:51 -0400] [Job 8] temp file (object 90 0, offset 1016933): stream dictionary lacks /Length key
W [24/Sep/2024:20:36:51 -0400] [Job 8] temp file (object 90 0, offset 1017023): attempting to recover stream length
W [24/Sep/2024:20:36:51 -0400] [Job 8] temp file (object 90 0, offset 1017023): recovered stream length: 18
E [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterPDFToPDF: load_file failed: temp file: unable to find trailer dictionary while recovering damaged file
E [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterChain: pdftopdf (PID 55450) stopped with status 1
E [24/Sep/2024:20:36:51 -0400] [Job 8] brlaser: No pages were found.
E [24/Sep/2024:20:36:51 -0400] [Job 8] Job stopped due to filter errors; please consult the /var/log/cups/error_log file for details.
D [24/Sep/2024:20:36:51 -0400] [Job 8] The following messages were recorded from 20:36:51 to 20:36:51
D [24/Sep/2024:20:36:51 -0400] [Job 8] Applying default options...
D [24/Sep/2024:20:36:51 -0400] [Job 8] Adding start banner page "none".
D [24/Sep/2024:20:36:51 -0400] [Job 8] Adding end banner page "none".
D [24/Sep/2024:20:36:51 -0400] [Job 8] File of type application/pdf queued by "jag".
D [24/Sep/2024:20:36:51 -0400] [Job 8] hold_until=0
D [24/Sep/2024:20:36:51 -0400] [Job 8] Queued on "Brother" by "jag".
D [24/Sep/2024:20:36:51 -0400] [Job 8] time-at-processing=1727224611
D [24/Sep/2024:20:36:51 -0400] [Job 8] 3 filters for job:
D [24/Sep/2024:20:36:51 -0400] [Job 8] - (application/pdf to application/vnd.universal-input, cost 0)
D [24/Sep/2024:20:36:51 -0400] [Job 8] universal (application/vnd.universal-input to application/vnd.cups-raster, cost 0)
D [24/Sep/2024:20:36:51 -0400] [Job 8] rastertobrlaser (application/vnd.cups-raster to printer/Brother, cost 33)
D [24/Sep/2024:20:36:51 -0400] [Job 8] job-sheets=none,none
D [24/Sep/2024:20:36:51 -0400] [Job 8] argv[0]="Brother"
D [24/Sep/2024:20:36:51 -0400] [Job 8] argv[1]="8"
D [24/Sep/2024:20:36:51 -0400] [Job 8] argv[2]="jag"
D [24/Sep/2024:20:36:51 -0400] [Job 8] argv[3]="why-we-dont-make-demands_print_color.pdf"
D [24/Sep/2024:20:36:51 -0400] [Job 8] argv[4]="1"
D [24/Sep/2024:20:36:51 -0400] [Job 8] argv[5]="PageSize=Letter Resolution=600dpi noCollate Duplex=DuplexTumble MediaType=PLAIN InputSlot=Auto nobrlaserEconomode number-up=1 job-uuid=urn:uuid:d88b633a-0673-3e61-6aff-3fbabc9faecc job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1727224611 time-at-processing=1727224611"
D [24/Sep/2024:20:36:51 -0400] [Job 8] argv[6]="/var/spool/cups/d00008-001"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[1]="CUPS_DATADIR=/usr/local/share/cups"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[2]="CUPS_DOCROOT=/usr/local/share/doc/cups"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[3]="CUPS_REQUESTROOT=/var/spool/cups"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[4]="CUPS_SERVERBIN=/usr/local/libexec/cups"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[5]="CUPS_SERVERROOT=/etc/cups"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[6]="CUPS_STATEDIR=/var/run/cups"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[7]="HOME=/var/spool/cups/tmp"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[8]="PATH=/usr/local/libexec/cups/filter:/usr/local/bin:/usr/local/sbin:/bin:/usr/bin"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[9]="SERVER_ADMIN=root@fig"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[10]="SOFTWARE=CUPS/2.4.10"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[11]="TMPDIR=/var/spool/cups/tmp"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[12]="USER=root"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[13]="CUPS_MAX_MESSAGE=2047"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[14]="CUPS_SERVER=/var/run/cups/cups.sock"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[15]="CUPS_ENCRYPTION=IfRequested"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[16]="IPP_PORT=631"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[17]="CHARSET=utf-8"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[18]="LANG=en_US.UTF-8"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[19]="PPD=/etc/cups/ppd/Brother.ppd"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[20]="CONTENT_TYPE=application/pdf"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[21]="DEVICE_URI=lpd://BRW5C619963C8A3/BINARY_P1"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[22]="PRINTER_INFO=Brother"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[23]="PRINTER_LOCATION="
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[24]="PRINTER=Brother"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[25]="PRINTER_STATE_REASONS=none"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[26]="CUPS_FILETYPE=document"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[27]="FINAL_CONTENT_TYPE=application/vnd.cups-raster"
D [24/Sep/2024:20:36:51 -0400] [Job 8] envp[28]="AUTH_I****"
D [24/Sep/2024:20:36:51 -0400] [Job 8] Started filter /usr/local/libexec/cups/filter/universal (PID 19848)
D [24/Sep/2024:20:36:51 -0400] [Job 8] Started filter /usr/local/libexec/cups/filter/rastertobrlaser (PID 16637)
D [24/Sep/2024:20:36:51 -0400] [Job 8] Started backend /usr/local/libexec/cups/backend/lpd (PID 84526)
D [24/Sep/2024:20:36:51 -0400] [Job 8] brlaser version 6
D [24/Sep/2024:20:36:51 -0400] [Job 8] Set job-printer-state-message to "brlaser version 6", current level=INFO
D [24/Sep/2024:20:36:51 -0400] [Job 8] STATE: +connecting-to-device
D [24/Sep/2024:20:36:51 -0400] [Job 8] Looking up \"BRW5C619963C8A3\"...
D [24/Sep/2024:20:36:51 -0400] [Job 8] ppdFilterLoadPPD: Color profile qualifier determined from job and PPD data \'.PLAIN.600dpi\'
D [24/Sep/2024:20:36:51 -0400] [Job 8] ppdFilterLoadPPD: No ICC profiles specified in PPD
D [24/Sep/2024:20:36:51 -0400] [Job 8] ppdFilterLoadPPD: Searching for profile \"600dpi/PLAIN\"...
D [24/Sep/2024:20:36:51 -0400] [Job 8] ppdFilterLoadPPD: Last filter determined by the PPD: rastertobrlaser; Final data MIME type: application/vnd.cups-raster => PDF filter will not log pages in page_log.
D [24/Sep/2024:20:36:51 -0400] [Job 8] ppdFilterUniversal: \"*cupsFilter(2): ...\" lines in the PPD file:
D [24/Sep/2024:20:36:51 -0400] [Job 8] ppdFilterUniversal: application/vnd.cups-raw application/octet-stream 0 -
D [24/Sep/2024:20:36:51 -0400] [Job 8] ppdFilterUniversal: application/vnd.cups-raster 33 rastertobrlaser
D [24/Sep/2024:20:36:51 -0400] [Job 8] ppdFilterUniversal: PPD uses \"*cupsFilter: ...\" lines, so we always convert to format given by FINAL_CONTENT_TYPE
D [24/Sep/2024:20:36:51 -0400] [Job 8] ppdFilterUniversal: Converting from application/pdf to application/vnd.cups-raster
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterUniversal: Converting from application/pdf to application/vnd.cups-raster
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterUniversal: Final output format for job: application/vnd.cups-raster
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterUniversal: Adding pdftopdf to chain
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterUniversal: Adding ghostscript to chain
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterChain: Running filter: pdftopdf
D [24/Sep/2024:20:36:51 -0400] [Job 8] Set job-printer-state-message to "cfFilterChain: Running filter: pdftopdf", current level=INFO
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterChain: Running filter: ghostscript
D [24/Sep/2024:20:36:51 -0400] [Job 8] Set job-printer-state-message to "cfFilterChain: Running filter: ghostscript", current level=INFO
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterChain: pdftopdf (PID 55450) started.
D [24/Sep/2024:20:36:51 -0400] [Job 8] Set job-printer-state-message to "cfFilterChain: pdftopdf (PID 55450) started.", current level=INFO
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterChain: ghostscript (PID 64781) started.
D [24/Sep/2024:20:36:51 -0400] [Job 8] Set job-printer-state-message to "cfFilterChain: ghostscript (PID 64781) started.", current level=INFO
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterGhostscript: Output format: CUPS Raster
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterGhostscript: Copying input to temp file \"/var/spool/cups/tmp/0fd0d66f736df\"
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterPDFToPDF: Suppressed page logging selected by options.
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterPDFToPDF: Processing PDF input with QPDF: Page-ranges, page-set, number-up, booklet, size adjustment, ...
D [24/Sep/2024:20:36:51 -0400] [Job 8] Set job-printer-state-message to "temp file: file is damaged", current level=WARN
D [24/Sep/2024:20:36:51 -0400] [Job 8] Set job-printer-state-message to "temp file: can\'t find startxref", current level=WARN
D [24/Sep/2024:20:36:51 -0400] [Job 8] Set job-printer-state-message to "temp file: Attempting to reconstruct cross-reference table", current level=WARN
D [24/Sep/2024:20:36:51 -0400] [Job 8] Set job-printer-state-message to "temp file (object 90 0, offset 1017080): EOF after endobj", current level=WARN
D [24/Sep/2024:20:36:51 -0400] [Job 8] Set job-printer-state-message to "temp file (object 90 0, offset 1016933): stream dictionary lacks /Length key", current level=WARN
D [24/Sep/2024:20:36:51 -0400] [Job 8] Set job-printer-state-message to "temp file (object 90 0, offset 1017023): attempting to recover stream length", current level=WARN
D [24/Sep/2024:20:36:51 -0400] [Job 8] Set job-printer-state-message to "temp file (object 90 0, offset 1017023): recovered stream length: 18", current level=WARN
D [24/Sep/2024:20:36:51 -0400] [Job 8] Set job-printer-state-message to "cfFilterPDFToPDF: load_file failed: temp file: unable to find trailer dictionary while recovering damaged file", current level=ERROR
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterChain: pdftopdf completed with status 1.
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterGhostscript: Input is empty, outputting empty file.
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterChain: ghostscript completed with status 0.
D [24/Sep/2024:20:36:51 -0400] [Job 8] cfFilterChain: ghostscript (PID 64781) exited with no errors.
D [24/Sep/2024:20:36:51 -0400] [Job 8] PID 19848 (/usr/local/libexec/cups/filter/universal) crashed on signal 11.
D [24/Sep/2024:20:36:51 -0400] [Job 8] Hint: Try setting the LogLevel to "debug" to find out more.
D [24/Sep/2024:20:36:51 -0400] [Job 8] PID 16637 (/usr/local/libexec/cups/filter/rastertobrlaser) exited with no errors.
D [24/Sep/2024:20:36:51 -0400] [Job 8] STATE: -connecting-to-device
D [24/Sep/2024:20:36:51 -0400] [Job 8] BRW5C619963C8A3=192.168.1.88
D [24/Sep/2024:20:36:51 -0400] [Job 8] backendWaitLoop(snmp_fd=5, addr=0x8b060c153c8, side_cb=0x8ae08715f20)
D [24/Sep/2024:20:36:51 -0400] [Job 8] PID 84526 (/usr/local/libexec/cups/backend/lpd) exited with no errors.
D [24/Sep/2024:20:36:51 -0400] [Job 8] End of messages
D [24/Sep/2024:20:36:51 -0400] [Job 8] printer-state=3(idle)
D [24/Sep/2024:20:36:51 -0400] [Job 8] printer-state-message="brlaser: No pages were found."
D [24/Sep/2024:20:36:51 -0400] [Job 8] printer-state-reasons=none
E [25/Sep/2024:03:45:44 -0400] Unknown directive IdleExitTimeout on line 32 of /etc/cups/cupsd.conf.
W [25/Sep/2024:03:45:44 -0400] Printer drivers are deprecated and will stop working in a future version of CUPS. See https://github.com/OpenPrinting/cups/issues/103
Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/cairo/Makefile,v
diff -u -p -u -r1.82 Makefile
--- Makefile 2 Sep 2024 07:08:13 -0000 1.82
+++ Makefile 25 Sep 2024 15:28:18 -0000
@@ -2,6 +2,7 @@ COMMENT= vector graphics library

GNOME_PROJECT= cairo
GNOME_VERSION= 1.18.2
+REVISION= 0

CATEGORIES= graphics
DPB_PROPERTIES= parallel
Index: patches/patch-src_cairo-cff-subset_c
===================================================================
RCS file: patches/patch-src_cairo-cff-subset_c
diff -N patches/patch-src_cairo-cff-subset_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_cairo-cff-subset_c 25 Sep 2024 15:28:18 -0000
@@ -0,0 +1,20 @@
+Index: src/cairo-cff-subset.c
+--- src/cairo-cff-subset.c.orig
++++ src/cairo-cff-subset.c
+@@ -952,9 +952,13 @@ cairo_cff_font_read_private_dict (cairo_cff_font_t *
+ decode_number (operand, nominal_width);
+
+ num_subs = _cairo_array_num_elements (local_sub_index);
+- *local_subs_used = _cairo_calloc_ab (num_subs, sizeof (cairo_bool_t));
+- if (unlikely (*local_subs_used == NULL))
+- return _cairo_error (CAIRO_STATUS_NO_MEMORY);
++ if (num_subs > 0) {
++ *local_subs_used = _cairo_calloc_ab (num_subs, sizeof (cairo_bool_t));
++ if (unlikely (*local_subs_used == NULL))
++ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
++ } else {
++ *local_subs_used = NULL;
++ }
+
+ if (num_subs < 1240)
+ *local_sub_bias = 107;
Hello,

I wanted to share that there's a printing regression that seems to be
caused by cairo and I'm seeing it on my system as well. Here are
reports from Arch:

https://gitlab.archlinux.org/archlinux/packaging/packages/cairo/-/issues/2

Here's the issue on cairo's Gitlab:

https://gitlab.freedesktop.org/cairo/cairo/-/issues/870

And here's the patch that fixes it:

https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/595/diffs

I applied the patch on my system, and it seems to work for me! I tried
it on a couple of documents that have been failing, but I haven't
extensively tested it, and I don't understand the fix so I'm not sure
what the best route here is (patch or wait for the next release?)

I'm attaching the cupsd error log and the patch for cairo.

--
he/him
jagtalon.net
weirder.earth/@jag

No comments:

Post a Comment