While testing for the AMD64 linux segfault (bug 688721), I ran all the pdf's I can find in my hard disc (about 1800 of them) through both 32-bit build and 64-build, with ps2pdf old.pdf new.pdf and found some difference in behavior. One of them must be wrong. Files to follow, and details of each.
Created attachment 2232 [details] Error: /rangecheck in --cvrs-- with this pdf on 64-bit 32-bit ghostscript works fine, 64-bit ghostscript fails with this error: /home/hin-tak/.wine/drive_c/Program Files/R/R-2.3.0/library/qvalue/doc/manual.pdf -Error: /rangecheck in --cvrs-- -Operand stack: - --dict:7/7(L)-- TT1 1 --dict:6/6(L)-- --dict:6/6(L)-- KDLOKD+TimesNewRoman --dict:11/12(ro)(G)-- --nostringval-- --dict:7/7(L)-- --dict :7/7(L)-- 150998 --dict:7/7(L)-- --nostringval-- FontMatrix --nostringval-- FontBBox --nostringval-- FontName -2147483631 16 (\000\000\ 000\000\000\000\000\000) -Execution stack: - %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval-- 4 1 12 --nostrin gval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %sto pped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %a rray_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- -Dictionary stack: - --dict:1121/1686(ro)(G)-- --dict:2/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:105/127(ro)(G)-- --dict:253/347(ro)(G)-- --dict:21/24 (L)-- --dict:4/6(L)-- --dict:27/32(L)-- --dict:33/50(ro)(G)-- --dict:24/40(L)-- -Current allocation mode is local -AFPL Ghostscript 8.54: Unrecoverable error, exit code 1
Created attachment 2233 [details] Many Warning's of 'rangecheck' error on 64-bit This pdf file generates many **** Warning: File encountered 'rangecheck' error while processing an image. with 64-bit ghostscript, but 32-bit ghostscript doesn't output such warnings.
I have got more than a few ( at least 5 to 10?) of each kind of the two errors among the 1800 pdf's. The errors don't look substantially different so I'll just mention it here without submitting files which have similiar problems.
Created attachment 2234 [details] patch for /rangecheck in --cvrs-- Fix string overflow in cvrs on 64-bit systems. Calculate numeric value of unique ID as 32-bit unsigned value that can be stored as 8-byte hexadecimal string but convert to signed and extend the sign to have a correct signed value in XUID.
Created attachment 2235 [details] patch for 'rangecheck' The problem may be caused by the padding data overwriting MaskedImage member in the subclass. See bug 613909 for details. The hack in 613909 doesn't fix all cases. The patch has not been tested.
Thanks - the two patches make 64-bit binary passes/fails on the same files as 32-bit binary.
The patch from the comment #4 causes a few regressions. A better patch will be posted soon.
The patch #5 has been tested and causes no regressions.
Created attachment 2245 [details] new patch for /rangecheck in cvrs This is a new patch for rangecheck in cvrs. The old patch mistakenly assumes that 16#80000000 xor 16#80000000 sub is a no-op on the 32-bit platform. In fact, PostScript arithmetics converts the result to float when it exceeds the integer range. The patch has been tested and causes on differences.
The patch for 'rangecheck' is committed as rev. 6843. The patch for 'rangecheck in --cvrs--' is committed as rev. 6844.