[Foo2zjs-maintainer] Bug#548334: Bug#548334: foo2zjs: Segmentation fault when printing in color

Christoph Haas haas at debian.org
Mon Sep 28 13:57:58 UTC 2009


Hi, Michael...

Michael Koch schrieb:
> On Mon, Sep 28, 2009 at 11:07:30AM +0200, Christoph Haas wrote:
>> Michael Koch schrieb:
>>>> D [25/Sep/2009:16:35:54 +0200] [Job 110] cat: Schreibfehler:
>>>> Daten<C3><BC>bergabe unterbrochen (broken pipe)
>>>> D [25/Sep/2009:16:35:54 +0200] [Job 110] Segmentation fault
>>>> D [25/Sep/2009:16:35:54 +0200] [Job 110] sed: Kann 65 Elemente nicht auf
>>>> stdout schreiben: Daten<C3><BC>bergabe unterbrochen (broken pipe)
>>> This looks like the culprit.
>>>
>>>> I'm not sure how to further debug it. I have tried to install the
>>>> Lenny versions of "ghostscript" and "foo2zjs" to no avail.
>>>>
>>>> I'm also not sure if this bug is connected to #534414. The package version
>>>> of ghostscript I have installed is "8.70~dfsg-2" and according to the
>>>> bug report the issue was resolved in 8.64 already.
>>> I don't think this bug is connected to #534414. I think its a bug in
>>> /usr/bin/foo2hp2600-wrapper. This is a shell script. Can you try to
>>> to track the bug down in this file a bit? There are not too many places
>>> using cat and sed.
>> I have set the /usr/bin/foo2hp2600-wrapper script to "-x" in the shebang
>> line to see what commands are run:
>>
>> D [28/Sep/2009:10:54:14 +0200] [Job 118] + USER=
>> D [28/Sep/2009:10:54:14 +0200] [Job 118] + GS=gs -q -dBATCH -dSAFER -dQUIET
>> -dNOPAUSE
>> D [28/Sep/2009:10:54:14 +0200] [Job 118] + foo2zjs-pstops -n -c -w
>> D [28/Sep/2009:10:54:14 +0200] [Job 118] + cat
>> D [28/Sep/2009:10:54:14 +0200] [Job 118] + gs -q -dBATCH -dSAFER -dQUIET
>> -dNOPAUSE -sPAPERSIZE=letter -g4960x7015 -r600x600 -sDEVICE=bitcmyk
>> -dCOLORSCREEN -dMaxBitmap=500000000 -sOutputFile=|cat 1>&3
>> /tmp/icc.usecie.ps -_
>> D [28/Sep/2009:10:54:14 +0200] [Job 118] + foo2hp -r600x600 -g4960x7015 -p1
>> -m1 -n1 -d1 -s7 -c -b1 -u 1x80 -l 1x80 -J  -U  -B -A -D1
>> D [28/Sep/2009:10:54:15 +0200] [Job 118] cat: Schreibfehler:
>> Daten<C3><BC>bergabe unterbrochen (broken pipe)
>> D [28/Sep/2009:10:54:15 +0200] [Job 118] Segmentation fault
>> D [28/Sep/2009:10:54:15 +0200] [Job 118] sed: Kann 65 Elemente nicht auf
>> stdout schreiben: Daten<C3><BC>bergabe unterbrochen (broken pipe)
>> D [28/Sep/2009:10:54:15 +0200] [Job 118] + [ -x /usr/bin/logger ]
>> D [28/Sep/2009:10:54:15 +0200] [Job 118] + logger -t foo2hp2600-wrapper -p
>> lpr.info -- gs -sPAPERSIZE=letter -g4960x7015 -r600x600 -sDEVICE=bitcmyk
>> -dCOLORSCREEN -dMaxBitmap=500000000  /tmp/icc.usecie.ps
>> D [28/Sep/2009:10:54:15 +0200] [Job 118] + logger -t foo2hp2600-wrapper -p
>> lpr.info -- foo2hp -r600x600 -g4960x7015 -p1 -m1 -n1 -d1 -s7 -c -b1 -u 1x80
>> -l 1x80   -B -A
>> D [28/Sep/2009:10:54:15 +0200] [Job 118] + [ 1 -eq 0 ]
>> D [28/Sep/2009:10:54:15 +0200] [Job 118] + exit 0
>> D [28/Sep/2009:10:54:15 +0200] [Job 118] renderer exited with status 0
>> D [28/Sep/2009:10:54:15 +0200] [Job 118] kid4 exited with status 0
>> D [28/Sep/2009:10:54:15 +0200] [Job 118] kid3 finished
>> D [28/Sep/2009:10:54:15 +0200] [Job 118] Read 72 bytes of print data...
>> D [28/Sep/2009:10:54:15 +0200] [Job 118] Wrote 72 bytes of print data...

> This looks like the segfault happens in foo2hp or so.
> 
> Is it possible that you edit foo2hp2600-wrapper and make a copy of the current
> document to some place? Then we can try to execute the steps done by it
> manually to reproduce the bug and see where the bug is for real.

Okay. I have replace the "| foo2hp ..." call by "| cat > /tmp/foo". And
/tmp/foo gets created but is empty:

-rw------- 1 lp lp 0 Sep 28 15:25 /tmp/foo

So it appears like "foo2hp" doesn't get any input.

> Or if this not possible that you create at least a file containing a document
> that I can feed here into foo2hp2600-wrapper together with your options.

Okay, first I used these lines in the wrapper script:

foo2zjs-pstops $PSTOPS_OPTS | \
$PREFILTER \
| cat > /tmp/foo

So I'm intercepting the output before it goes into "$GS $PAPERSIZE ...". I
have attached the file as foo.gz.

Then I was feeding that into the "gs" call like:

$> cat /tmp/foo | gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE
-sPAPERSIZE=letter -g4960x7015 -r600x600 -sDEVICE=bitcmyk -dCOLORSCREEN
-dMaxBitmap=500000000 -sOutputFile=|cat 1>&3 /tmp/icc.usecie.ps -_ | cat >
/tmp/foo2

The result:

zsh: 3: bad file descriptor


I have also attached the inkscape file (the tux.png has to be in the same
directory so that inkscape can find the linked file).

Interestingly printing from Inkscape of this very file fails (segfault as
above) but first exporting it to Postscript and then printing it works well
(although the printer asks for A4 paper - that is already in the tray).

So it's not a general problem. Not even if the document contains color or
not. Perhaps Postscript files containing just text get printed well but
those which contain additional bitmap graphics don't.

 Christoph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tux.png
Type: image/png
Size: 67452 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/foo2zjs-maintainer/attachments/20090928/dd50aaa4/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.svg
Type: image/svg+xml
Size: 5367 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/foo2zjs-maintainer/attachments/20090928/dd50aaa4/attachment-0001.svg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.gz
Type: application/x-gzip
Size: 505440 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/foo2zjs-maintainer/attachments/20090928/dd50aaa4/attachment-0001.bin>


More information about the Foo2zjs-maintainer mailing list