Bug 689326

Summary: Ubuntu patch to fix coredumps
Product: Ghostscript Reporter: Till Kamppeter <till.kamppeter>
Component: GeneralAssignee: Till Kamppeter <till.kamppeter>
Status: NOTIFIED WORKSFORME    
Severity: normal    
Priority: P4    
Version: master   
Hardware: All   
OS: All   
URL: http://www.cups.org/str.php?L1635
Customer: Word Size: ---
Bug Depends on:    
Bug Blocks: 689315    
Attachments: Patch to fix crash bugs
Another patch to fix these bugs, use the more suitable one

Description Till Kamppeter 2007-07-04 08:47:49 UTC
See

http://www.cups.org/str.php?L1635

------------------------------------------------------------------------------
Description from the ubuntu changelog:
  * Close and reopen x11 driver when size changes.  Fixes
    coredump in x11 driver under gv with antialiasing turned
    (reproducible in 8.01 on a 16bbp display).
    Related to Ubuntu 17141, and to fix for Debian #254206.

  * Fix coredumping bug on ppc: Ubuntu bugzilla:
     http://bugzilla.ubuntu.com/show_bug.cgi?id=14311
     http://bugzilla.ubuntu.com/show_bug.cgi?id=13771
    This is the same issue as
     http://bugs.ghostscript.com/show_bug.cgi?id=687643
     http://bugs.ghostscript.com/show_bug.cgi?id=687730
    discussed in
     http://ghostscript.com/pipermail/gs-code-review/2004-September/004649.html
    and probably the same as Debian bugs #324796 and #325570 and
    perhaps others in Debian's gs-esp and gs-gpl.

    This bug is due to gs's incorrect assumption that (where ref is an
    important struct inside gs) sizeof(ref) % alignof(jmp_buf) == 0.  This
    is not true on ppc and apparently not necessarily on Itanium either.

    The `fix' I have applied is to wrap setjmp/longjmp up in macros which
    arrange for jmp_buf to have alignment 1, as sketched out in the URLs
    above.  A previous attempt to fix it by padding ref out to the
    alignment of jmp_buf failed and I don't know why; but I suspect other
    unjustified assumptions in gs.

    GhostScript's algorithms ought to be repaired not to assume
    falsehoods.
------------------------------------------------------------------------------

Patch attached.
Comment 1 Till Kamppeter 2007-07-04 08:48:53 UTC
Created attachment 3149 [details]
Patch to fix crash bugs
Comment 2 Till Kamppeter 2007-07-04 08:51:14 UTC
Created attachment 3150 [details]
Another patch to fix these bugs, use the more suitable one
Comment 3 Ray Johnston 2007-07-10 09:42:06 UTC
Please re-test (on the appropriate machine).  
  
We believe that Raph fixed this before closing 
http://bugs.ghostscript.com/show_bug.cgi?id=687643 
 
Without more test case examples we cannot duplicate the problem. 
Comment 4 Till Kamppeter 2007-07-10 09:57:28 UTC
Unfortunately, I cannot test the second point as I do not have a PPC machine. I
did not hit this bug by myself. I have reported this because the problem
occurred and was fixed in ESP GS and so it is a potential problem in GPL GS.