foomatic fails when printing from OSX client, bash error [arg length ???]
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
foomatic-filters (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Precise |
Fix Released
|
High
|
Till Kamppeter |
Bug Description
Submitting PDF jobs from an OSX 10.7.4 laptop to a Linux desktop running 12.04 amd64 over CUPS/IPP, with USB-attached HP Laserjet 1020.
Job goes into "stopped" state. /var/log/
...
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
D [30/Jun/
E [30/Jun/
I refer especially to the log line "/bin/bash: -c: line 0: unexpected EOF while looking for matching `''
[Impact] Printing from Mac OS X clients to all printers with foo2zjs drivers ("Foomatic/
[Test Case] To reproduce without having the appropriate printer (foo2zjs must be installed):
cupsctl FileDevice=yes
cupsctl LogLevel=debug
lpadmin -p test -E -v file:/tmp/printout -m foo2zjs:
lp -d test -o testoption=`perl -e 'for($i = 0; $i < 200; $i ++) { $a .= sprintf ("%10d", $i) }; $a =~ s/ /-/g; print "$a\n"; '` ~/.bashrc
lpstat -o
Note that the Perl magic generates a string which is 2000 characters long. This will be inserted as value for the option "testoption". foomatic-rip of Precise will error out as shown above. The job will hang in the queue.
After installing the proposed package and reprinting the job (via the job viewer) or sending the job again one will see that these jobs get printed (job gets removed from the queue, /tmp/printout will contain the print data).
[Regression Potential] The two fix in the C code is trivial, only the maximum length for a string will be raised, so regressions cannot be caused.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: foomatic-filters 4.0.16-0ubuntu0.1
ProcVersionSign
Uname: Linux 3.2.0-25-generic x86_64
ApportVersion: 2.0.1-0ubuntu8
Architecture: amd64
Date: Sat Jun 30 21:49:08 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
Lpstat: device for HP-LaserJet-1020: hp:/usb/
MachineType: Dell Inc. Inspiron 400
Papersize: a4
PpdFiles: HP-LaserJet-1020: HP LaserJet 1020 Foomatic/foo2zjs-z1 (recommended)
ProcEnviron:
LANGUAGE=en_GB:en
TERM=xterm
PATH=(custom, user)
LANG=en_GB.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=
SourcePackage: foomatic-filters
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 09/04/2009
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A01
dmi.board.name: 03D1TV
dmi.board.vendor: Dell Inc.
dmi.board.version: A00
dmi.chassis.type: 3
dmi.chassis.vendor: Dell Inc.
dmi.chassis.
dmi.modalias: dmi:bvnDellInc.
dmi.product.name: Inspiron 400
dmi.product.
dmi.sys.vendor: Dell Inc.
Changed in foomatic-filters (Ubuntu): | |
status: | New → In Progress |
Changed in foomatic-filters (Ubuntu Precise): | |
status: | New → Triaged |
importance: | Undecided → Medium |
importance: | Medium → High |
milestone: | none → ubuntu-12.04.1 |
description: | updated |
Changed in foomatic-filters (Ubuntu Precise): | |
assignee: | nobody → Till Kamppeter (till-kamppeter) |
Changed in foomatic-filters (Ubuntu Precise): | |
status: | Triaged → Fix Committed |
Additional info: OSX client shows "/usr/lib/ cups/filter/ foomatic- rip failed" and "Error: job stopped on server"
On the server, running "strace -s 2048 -v -f -p <pid of cups> 2>log" before submitting the job, I captured the following:
... gMode=AP_ ApplicationColo rMatching AP_D_InputSlot= nocollate com.apple. print.DocumentT icket.PMSpoolFo rmat=applicatio n/pdf com.apple. print.JobInfo. PMApplicationNa me=Preview com.apple. print.JobInfo. PMJobName= test.pdf com.apple. print.JobInfo. PMJobOwner= Brian\\ Candler com.apple. print.PageToPap erMappingMediaN ame=A4 com.apple. print.PageToPap erMappingType. .n.=1 com.apple. print.PrinterIn fo.PMColorDevic eID..n. =9784 com.apple. print.PrintSett ings.PMColorMat chingMode. .n.=0 com.apple. print.PrintSett ings.PMColorSpa ceModel. .n.=1 com.apple. print.PrintSett ings.PMColorSyn cProfileID. .n.=1580 com.apple. print.PrintSett ings.PMCopies. .n.=1 com.apple. print.PrintSett ings.PMCopyColl ate..b. com.apple. print.PrintSett ings.PMDestinat ionType. .n.=1 com.apple. print.PrintSett ings.PMFirstPag e..n.=1 com.apple. print.PrintSett ings.PMLastPage ..n.=2147483647 com.apple. print.PrintSett ings.PMPageRang e..a.0. .n.=1 com.apple. print.PrintSett ings.PMPageRang e..a.1. .n.=2147483647 com.apple. print.PrintSett "], ["CUPS_ CACHEDIR= /var/cache/ cups", "CUPS_DATADIR= /usr/share/ cups", "CUPS_DOCROOT= /usr/share/ cups/doc- root", "CUPS_FONTPATH= /usr/share/ cups/fonts" , "CUPS_REQUESTRO OT=/var/ spool/cups" , "CUPS_SERVERBIN =/usr/lib/ cups", "CUPS_SERVERROO T=/etc/ cups", "CUPS_STATEDIR= /var/run/ cups", "HOME=/ var/spool/ cups/tmp" , "PATH=/ usr/lib/ cups/filter: /usr/bin: /usr/sbin: /bin:/usr/ bin", "SERVER_ ADMIN=root@ zino", "SOFTWARE= CUPS/1. 5.3", "TMPDIR= /var/spool/ cups/tmp" , "USER=root", "CUPS_SERVER= /var/run/ cups/cups. sock", "CUPS_ENCRYPTIO N=IfRequested" , "IPP_PORT=631", "CHARSET=utf-8", "LANG=en_US.UTF-8", "PPD=/etc/ cups/ppd/ HP-LaserJet- 1020.ppd" , "RIP_MAX_ CACHE=128m" , "CONTENT_ TYPE=applicatio n/pdf", "DEVICE_ URI=hp: /usb/HP_ LaserJet_ 1020?serial= JL3FLCA" , "PRINTER_ INFO=Hewlett- Packard HP LaserJet 1020", "PRINTER_ LOCATION= zino", "PRINTER= HP-LaserJet- 1020", "PRINTER_ STATE_REASONS= none", "CUPS_FILETYPE= document" , "FINAL_ CONTENT_ TYPE=printer/ HP-LaserJet- 1020", "AUTH_INFO_ REQUIRED= none", "GS_LIB= /usr/share/ cups/fonts" ] <unfinished ...>
[pid 16670] execve("/bin/bash", ["/bin/bash", "-c", "pdftops '78' 'brian' 'test.pdf' '1' ' AP_ColorMatchin
The length of the string "pdftops '78' ...... com.apple. print.PrintSett " is exactly 1024 bytes, not including the outside double-quotes, so it looks like some fixed-sized internal buffer has been hit on the job properties.
(Aside: quite why a shell is being used here, rather than execve of pdftops directly, is unclear to me)