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

Michael Koch konqueror at gmx.de
Mon Sep 28 21:09:31 UTC 2009


Hello Christoph,


On Mon, Sep 28, 2009 at 03:57:58PM +0200, Christoph Haas wrote:
> 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

That is because the " around 'cat 1>&3' are missing. They are in the original
wrapper code.

I tries this locally and got:

cat foo | gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE -sPAPERSIZE=letter -g4960x7015 -r600x600 -sDEVICE=bitcmyk -dCOLORSCREEN -dMaxBitmap=500000000 -sOutputFile="|cat 1>&3" /tmp/icc.usecie.ps -_ > foo2
GPL Ghostscript 8.70: Unrecoverable error, exit code 1

So your input seem to trigger a ghostscript segfault.

Can you confirm this?


Cheers,
Michael





More information about the Foo2zjs-maintainer mailing list