Bug 691065 - undefined in setpagedevice
Summary: undefined in setpagedevice
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Interpreter (show other bugs)
Version: master
Hardware: All All
: P4 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-18 00:36 UTC by Masaki Ushizaka
Modified: 2010-01-30 12:28 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
b691065_a1.patch (493 bytes, patch)
2010-01-18 00:39 UTC, Masaki Ushizaka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Masaki Ushizaka 2010-01-18 00:36:11 UTC
While looking for a reason why 29-07C.PS in PS3CET hinder consistent result, I found a problem in 
current setpagedevice.

The difference was caused by i7 machine, on page 2 and 4, where it generated undefined errors where 
they should be a configrationerror.

'undefined' error was happening because .selectmedia procedure in gs_setpd.ps was building an error 
information dictionary ('<failed>' in its comment) with many keys those doesn't exist in <request> 
dictionary, such as /LeadinEdge or /InsertSheet.  This draws the policy 0 procedure (line 544) to 'get' 
non-existant keys from <merged> dictionary.

I have done above observations oh trunk rev. 10609.

I have not confirmed why this didn't happen on i7a and macpro machines, but I guess on those 
machines, /PageSize happend to be the first key pulled out from <failed> dictionary so it didn't end up 
with 'undeinfed'

Reproducing procedure:

---begin test.ps
%!
% Remove all but 'letter' page size
<<
  /InputAttributes currentpagedevice /InputAttributes get
  1 1 2 index length 1 sub {
    1 index exch undef
  } for
>> setpagedevice
<< /Policies << /PolicyNotFound 0 >> /PageSize [ 500 700 ] >> setpagedevice
---end test.ps

$ bin/gs -q -IResource/Init -sDEVICE=pbmraw -o /dev/null -dBATCH test.ps
Comment 1 Masaki Ushizaka 2010-01-18 00:39:32 UTC
Created attachment 5880 [details]
b691065_a1.patch

A patch.  With this, the behavior of .selectmedia procedure become consistent
with what described in comment just above.
Comment 2 Alex Cherepanov 2010-01-30 12:28:49 UTC
I agree with the analysis of the problem and the proposed patch.
I've committed the patch as a rev. 10676.

Regression testing shows improvements in stdout log generated
by 29-07C.PS CET test file.