foomatic-rip crashes if media is blank

Bug #1479871 reported by Alex Korobkin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cups-filters (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

How to reproduce:
Submit a job with media= to a printer that has foomatic-rip as one of its filters.

lp -d myprinter -o media= /tmp/page.pdf

This will happen:

D [Job 977] Pondering option 'media='
D [Job 977] mf: filter/foomatic-rip/options.c:486: option_find_choice: Assertion `opt && name' failed.
D [Job 977] PID 12709 (/usr/lib/cups/filter/foomatic-rip) crashed on signal 6.

I know it is bad idea to submit a job with blank media=, but hey, some bad software submit it like that and I'd rather have it printed in wrong size than have foomatic crashed on the job.

tested with cups-filters 1.0.69 and CUPS 1.7.5 on Ubuntu 12.04

Whole log of a job:
I [Job 977] Adding start banner page "none".
I [Job 977] Queued on "mf" by "korobkin".
D [Job 977] Auto-typing file...
D [Job 977] Request file type is application/pdf.
I [Job 977] File of type application/pdf queued by "korobkin".
I [Job 977] Adding end banner page "none".
D [Job 977] time-at-processing=1438271262
D [Job 977] 2 filters for job:
D [Job 977] pdftopdf (application/pdf to application/vnd.cups-pdf, cost 66)
D [Job 977] foomatic-rip (application/vnd.cups-pdf to printer/mf, cost 0)
D [Job 977] job-sheets=none,none
D [Job 977] argv[0]="mf"
D [Job 977] argv[1]="977"
D [Job 977] argv[2]="korobkin"
D [Job 977] argv[3]="page.pdf"
D [Job 977] argv[4]="1"
D [Job 977] argv[5]="finishings=3 media= number-up=1 job-uuid=urn:uuid:dd456ed8-b115-3112-6040-872930439147 job-originating-host-name=localhost time-at-creation=1438271262 time-at-processing=1438271262"
D [Job 977] argv[6]="/var/spool/cups/d00977-001"
D [Job 977] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
D [Job 977] envp[1]="CUPS_DATADIR=/usr/share/cups"
D [Job 977] envp[2]="CUPS_DOCROOT=/usr/share/cups/doc-root"
D [Job 977] envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
D [Job 977] envp[4]="CUPS_REQUESTROOT=/var/spool/cups"
D [Job 977] envp[5]="CUPS_SERVERBIN=/usr/lib/cups"
D [Job 977] envp[6]="CUPS_SERVERROOT=/etc/cups"
D [Job 977] envp[7]="CUPS_STATEDIR=/var/run/cups"
D [Job 977] envp[8]="HOME=/var/spool/cups/tmp"
D [Job 977] envp[9]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
D [Job 977] envp[10]="<email address hidden>"
D [Job 977] envp[11]="SOFTWARE=CUPS/1.7.5"
D [Job 977] envp[12]="TMPDIR=/var/spool/cups/tmp"
D [Job 977] envp[13]="USER=root"
D [Job 977] envp[14]="CUPS_MAX_MESSAGE=2047"
D [Job 977] envp[15]="CUPS_SERVER=/var/run/cups/cups.sock"
D [Job 977] envp[16]="CUPS_ENCRYPTION=IfRequested"
D [Job 977] envp[17]="IPP_PORT=631"
D [Job 977] envp[18]="CHARSET=utf-8"
D [Job 977] envp[19]="LANG=en_US.UTF-8"
D [Job 977] envp[20]="PPD=/etc/cups/ppd/mf.ppd"
D [Job 977] envp[21]="RIP_MAX_CACHE=128m"
D [Job 977] envp[22]="CONTENT_TYPE=application/pdf"
D [Job 977] envp[23]="DEVICE_URI=socket://mf.wat"
D [Job 977] envp[24]="PRINTER_INFO=mf"
D [Job 977] envp[25]="PRINTER_LOCATION=TEST"
D [Job 977] envp[26]="PRINTER=mf"
D [Job 977] envp[27]="PRINTER_STATE_REASONS=none"
D [Job 977] envp[28]="CUPS_FILETYPE=document"
D [Job 977] envp[29]="FINAL_CONTENT_TYPE=printer/mf"
D [Job 977] envp[30]="AUTH_I****"
I [Job 977] Started filter /usr/lib/cups/filter/pdftopdf (PID 12708)
I [Job 977] Started filter /usr/lib/cups/filter/foomatic-rip (PID 12709)
I [Job 977] Started backend /usr/lib/cups/backend/socket (PID 12710)
D [Job 977] Calling FindDeviceById(cups-mf)
D [Job 977] Failed to send: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
D [Job 977] Failed to get find device cups-mf
D [Job 977] 'CM Color Calibration' Mode in SPOOLER-LESS: Off
D [Job 977] Getting input from file
D [Job 977] foomatic-rip version 1.0.69 running...
D [Job 977] Parsing PPD file ...
D [Job 977] Added option ColorSpace
D [Job 977] Added option LargeCapacityTray
D [Job 977] Added option OptionTray
D [Job 977] Added option ShiftTray
D [Job 977] Added option InnerTray2
D [Job 977] Added option ExternalTray
D [Job 977] Added option Finisher
D [Job 977] Added option ColorModel
D [Job 977] Added option Resolution
D [Job 977] Added option Duplex
D [Job 977] Added option Collate
D [Job 977] Added option PageSize
D [Job 977] STATE: +connecting-to-device
D [Job 977] Added option ImageableArea
D [Job 977] Looking up "mf.wat"...
D [Job 977] Added option PaperDimension
D [Job 977] Added option InputSlot
D [Job 977] Added option RIPrintMode
D [Job 977] Added option RPSBitsPerPixel
D [Job 977] Added option MediaType
D [Job 977] Added option OutputBin
D [Job 977] Added option StapleLocation
D [Job 977] backendWaitLoop(snmp_fd=5, addr=0x7fea676a9168, side_cb=0x7fea6654f1d0)
D [Job 977] Added option RIPunch
D [Job 977] Added option JobHeader
D [Job 977] Added option JobType
D [Job 977] Added option Pin1
D [Job 977] Added option Pin2
D [Job 977] Added option Pin3
D [Job 977] Added option Pin4
D [Job 977] Added option Font
D [Job 977] Parameter Summary
D [Job 977] -----------------
D [Job 977] Spooler: cups
D [Job 977] Printer: mf
D [Job 977] Shell: /bin/bash
D [Job 977] PPD file: /etc/cups/ppd/mf.ppd
D [Job 977] ATTR file:
D [Job 977] Printer model: Ricoh Aficio MP C3003 PDF cups-team recommended
D [Job 977] Job title: page.pdf
D [Job 977] File(s) to be printed:
D [Job 977] <STDIN>
D [Job 977] Ghostscript extra search path ('GS_LIB'): /usr/share/cups/fonts
D [Job 977] Printing system options:
D [Job 977] Pondering option 'finishings=3'
D [Job 977] Unknown option finishings=3.
D [Job 977] Pondering option 'media='
D [Job 977] mf: filter/foomatic-rip/options.c:486: option_find_choice: Assertion `opt && name' failed.
D [Job 977] PID 12708 (/usr/lib/cups/filter/pdftopdf) exited with no errors.
D [Job 977] PID 12709 (/usr/lib/cups/filter/foomatic-rip) crashed on signal 6.
D [Job 977] PID 12710 (/usr/lib/cups/backend/socket) exited with no errors.
E [Job 977] Job stopped due to filter errors; please consult the error_log file for details.
D [Job 977] Unloading...

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Fixed in the upstream BZR repository of cups-filters. Fix will be in the cups-filters 1.0.72 package.

Changed in cups-filters (Ubuntu):
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups-filters - 1.0.73-1

---------------
cups-filters (1.0.73-1) experimental; urgency=low

  * New upstream release
    - cups-browsed: Added LDAP support. Appropriately configured via
      cups-browsed.conf remote printers made available via LDAP will be
      looked up and local queues pointing to them created. Thanks to
      Raphael Geissert for contributing this patch (Closes: #795185)
    - foomatic-rip: Prevent crash when supplying "media" option with empty
      value ("media=", LP: #1479871)

  * Drop patches, all included upstream
  * Add a B-D on libldap2-dev for the new LDAP browsing support
  * Correct the CVE identifier in the previous upload

 -- Didier Raboud <email address hidden> Wed, 19 Aug 2015 18:04:54 +0200

Changed in cups-filters (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.