Bug 693268 - Crash with 478-01.ps
Summary: Crash with 478-01.ps
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Interpreter (show other bugs)
Version: master
Hardware: PC Windows 7
: P4 critical
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-12 18:09 UTC by Ray Johnston
Modified: 2012-08-23 06:19 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ray Johnston 2012-08-12 18:09:55 UTC
I started trying to look at the shading regression bug with this file and find
that HEAD crashes.

I ran git bisect and Alex's commit:
   86f9af6937e76e10a7adad201b06c337b1a9240b
was the cause.

Note I am using VS 2008 (MSVC_VER=9) building 32-bit binaries. The command
line is:

gswin32c -q -r300 -dNOPAUSE -dBATCH tests_private/comparefiles/478-01.ps

and also segfaults with:

gswin32c -q -r300 -sDEVICE=ppmraw -o x.ppm tests_private/comparefiles/478-01.ps

I haven't looked into it much, but it is failing during GC.

I suggest considering reversion of the patch until this is found/fixed.
Comment 1 Alex Cherepanov 2012-08-12 22:01:20 UTC
The problem is reproduced on Windows but the file works fine on
32 and 64 bit Linux.

We need regression testing on every platform we support.
Comment 2 Marcos H. Woehrmann 2012-08-14 13:59:06 UTC
(In reply to comment #1)
> We need regression testing on every platform we support.

I agree with Alex's suggestion that we drop support for Windows.
Comment 3 Alex Cherepanov 2012-08-14 14:51:37 UTC
The problem is caused by the fact that on Windows obj_align_mod == 8 but
sizeof(ref) == 12. On Linux x86 obj_align_mod == 4, Linux AMD64 sizeof(ref)==16

We need either
- don't require sizeof(ref) % obj_align_mod == 0
- always use 16-byte ref's or pad the ref when obj_align_mod == 8
- don't set obj_align_mod == 8 on x86 or ppc32
Comment 4 Alex Cherepanov 2012-08-23 06:19:21 UTC
Reinstate big references.
Make them compatible with 8-byte alignment on 32-bit Windows by adding
a dummy uint64_t member to the union that increases the sizeof(ref) to 16.

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=2740bef445c51680d831ec40753436291f01760a