Bug 694811 - Pdf Interpreter hangs in 9.10. Works fine in 9.07.
Summary: Pdf Interpreter hangs in 9.10. Works fine in 9.07.
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Graphics Library (show other bugs)
Version: 9.10
Hardware: PC Linux
: P4 normal
Assignee: Michael Vrhel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-27 06:59 UTC by wilfried
Modified: 2013-12-16 08:34 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
Pdf Document producing blocker. (3.94 MB, application/x-download)
2013-11-27 06:59 UTC, wilfried
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wilfried 2013-11-27 06:59:15 UTC
Created attachment 10425 [details]
Pdf Document producing blocker.

Following command:

/bin/gs -dPDFDEBUG -dMaxBitmap=0 -sDEVICE=pngalpha -q -dNOPAUSE -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dUseCropBox -r300x300 -dFirstPage=1 -dLastPage=1 -sOutputFile="./tmp/Tomaten.pdf_0001.png" -c 0 0 translate -dSAFER "./tmp/Tomaten.pdf" -c showpage -c quit

Stops in outputting Debug messages with:

%Resolving: [266 0]
/T1_6 1 Tf
%Resolving: [131 0]
17.8658 2.1936 -2.1936 17.8658 1733.27161 1017.75739 Tm
[
(T) 98 (ext n) 19 (ur P) 5 (l) -3 (a) 19 (tzh) 3 (a) -5 (l) 12 (t) 6 (er) ]
TJ
ET

Thanks in advance
Wilfried
Comment 1 Ken Sharp 2013-11-27 08:15:26 UTC
The problem only exhibits with the pngalpha device, and is transparency related, nothing to do with the PDF interpreter.

A much simpler command line '-sDEVICE=pngalpha -sOutputFile=out.png' is sufficient.

Michael, in gdevp14.c around line 2411 I see:

                    if (overprint) {
                        if (blendspot) {
                            /* Overprint simulation of spot colorants */
                            for (k = 0; k < num_comp; ++i) {
                                int temp = 
                                    (255 - dst_ptr[k * planestride]) * dst[k];
                                temp = temp >> 8;
                                dst_ptr[k * planestride] = (255 - temp);
                            }

Notice the loop runs from k=0 to k=num_comps, but the counter which is incremented is 'i', which is not used in this loop, hence we endlessly cycle.

Naively modifying this to '++k' (which matches the other loops) and the file runs to completion, the output appears broadly correct (its a large complex page so its hard to be certain). However since its not my code I have no idea if this is correct.