From nobody@FreeBSD.org  Sun Apr 12 04:33:36 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 20B09106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 12 Apr 2009 04:33:36 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 0ECB48FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 12 Apr 2009 04:33:36 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n3C4XZWj051755
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 12 Apr 2009 04:33:35 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n3C4XZUv051754;
	Sun, 12 Apr 2009 04:33:35 GMT
	(envelope-from nobody)
Message-Id: <200904120433.n3C4XZUv051754@www.freebsd.org>
Date: Sun, 12 Apr 2009 04:33:35 GMT
From: Yousuke HARADA <hyousuke@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] print/ghostscript7 crash bug
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         133641
>Category:       ports
>Synopsis:       [PATCH] print/ghostscript7 crash bug
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    doceng
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 12 04:40:02 UTC 2009
>Closed-Date:    Sat Apr 03 07:14:08 UTC 2010
>Last-Modified:  Sat Apr 03 07:14:08 UTC 2010
>Originator:     Yousuke HARADA
>Release:        FreeBSD 7.0-RELEASE-p1 i386
>Organization:
>Environment:
FreeBSD rio.dsp.to 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #0: Sun May 25 20:46:28 JST 2008     root@rio.dsp.to:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
Due to bug of print/ghostscript7, graphics/ImageMagick cannot be installed( test dumps core and fails).

Stacktrace: 
#0  0x081e63ea in gx_device_retain (dev=0x810, retained=1)
    at ./src/gsdevice.c:439
#1  0x080dcab9 in gx_begin_image3x_generic (dev=0x2886f194, pis=0x2872a034,
    pmat=0x2872a098, pic=0xbfbfd254, prect=0x0, pdcolor=0x2885c2b4,
    pcpath=0x2885c138, mem=0x28710834, make_mid=0x80daec8 <make_midx_default>,
    make_mcde=0x80dadf0 <make_mcdex_default>, pinfo=0xbfbfd1dc)
    at ./src/gximag3x.c:331
#2  0x080dcc68 in gx_begin_image3x (dev=0x2886f194, pis=0x2872a034, pmat=0x0,
    pic=0xbfbfd254, prect=0x0, pdcolor=0x2885c2b4, pcpath=0x2885c138,
    mem=0x28710834, pinfo=0xbfbfd1dc) at ./src/gximag3x.c:568
#3  0x08224484 in gx_default_begin_typed_image (dev=0x2886f194,
    pis=0x2872a034, pmat=0x0, pic=0xbfbfd254, prect=0x0, pdcolor=0x2885c2b4,
    pcpath=0x2885c138, memory=0x28710834, pinfo=0xbfbfd1dc)
    at ./src/gdevddrw.c:635
#4  0x080dfc04 in pdf14_begin_typed_image (dev=0x2885f1a4, pis=0x2872a034,
    pmat=0x0, pic=0xbfbfd254, prect=0x0, pdcolor=0x2885c2b4,
    pcpath=0x2885c138, mem=0x28710834, pinfo=0xbfbfd1dc) at ./src/gdevp14.c:879
#5  0x081ee04d in gs_image_begin_typed (pic=0xbfbfd254, pgs=0x2872a034,
    uses_color=0, ppie=0xbfbfd1dc) at ./src/gsimage.c:170
#6  0x080b936e in zimage_setup (i_ctx_p=0x2873b158, pim=0xbfbfd254,
    sources=0xbfbfd214, uses_color=0, npop=1) at ./src/zimage.c:155
#7  0x080d9eae in zimage3x (i_ctx_p=0x2873b158) at ./src/ztrans.c:366
#8  0x080945bb in call_operator (op_proc=Variable "op_proc" is not available.
) at ./src/interp.c:107
#9  0x0809590c in gs_interpret (pi_ctx_p=0x83f0d64, pref=0xbfbfd940,
    user_errors=1, pexit_code=0xbfbfd9d8, perror_object=0xbfbfd9d0)
    at ./src/interp.c:1123
#10 0x0808cd17 in gs_main_interpret (minst=0x83f0b60, pref=Variable "pref" is not available.
)
    at ./src/imain.c:207
#11 0x0808d02d in gs_main_run_string_end (minst=0x83f0b60, user_errors=1,
    pexit_code=0xbfbfd9d8, perror_object=0xbfbfd9d0) at ./src/imain.c:595
#12 0x0808d2a6 in gs_main_run_string_with_length (minst=0x83f0b60,
    str=0x287640f8 "<2f7661722f746d702f6d616769636b2d3270724e44726a4c>.runfile", length=58, user_errors=1, pexit_code=0xbfbfd9d8, perror_object=0xbfbfd9d0)
    at ./src/imain.c:553
#13 0x0808d2e8 in gs_main_run_string (minst=0x83f0b60,
    str=0x287640f8 "<2f7661722f746d702f6d616769636b2d3270724e44726a4c>.runfile", user_errors=1, pexit_code=0xbfbfd9d8, perror_object=0xbfbfd9d0)
    at ./src/imain.c:535
#14 0x0808dc37 in run_string (minst=0x83f0b60, str=Variable "str" is not available.
) at ./src/imainarg.c:758
#15 0x0808e263 in runarg (minst=0x83f0b60, pre=0x82b678c "",
    arg=0xbfbfece9 "/var/tmp/magick-2prNDrjL", post=0x8262a48 ".runfile",
    options=Variable "options" is not available.
) at ./src/imainarg.c:750
#16 0x0808e406 in argproc (minst=0x83f0b60,
    arg=0xbfbfece9 "/var/tmp/magick-2prNDrjL") at ./src/imainarg.c:687
#17 0x0808e83a in swproc (minst=0x83f0b60,
    arg=0xbfbfece9 "/var/tmp/magick-2prNDrjL", pal=0xbfbfe180)
    at ./src/imainarg.c:385
#18 0x0808f4e3 in gs_main_init_with_args (minst=0x83f0b60, argc=18,
    argv=0xbfbfeab4) at ./src/imainarg.c:202
#19 0x0804bd10 in main (argc=Cannot access memory at address 0x0
) at ./src/gs.c:47

>How-To-Repeat:
cd /usr/ports/graphics/ImageMagick/ ; make install
>Fix:
Apply the patch.

Patch attached with submission follows:

--- src/gximag3x.c.org  2009-04-12 12:49:53.000000000 +0900
+++ src/gximag3x.c 2009-04-12 12:50:14.000000000 +0900
@@ -215,8 +215,8 @@
        gs_color_space *pmcs;

        if (penum->mask[i].depth == 0) {        /* mask not supplied */
-           midev[0] = 0;
-           minfo[0] = 0;
+           midev[i] = 0;
+           minfo[i] = 0;
            continue;
        }
        pmcs =  gs_alloc_struct(mem, gs_color_space, &st_color_space,


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->doceng 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Apr 12 04:40:13 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133641 
State-Changed-From-To: open->closed 
State-Changed-By: hrs 
State-Changed-When: Sat Apr 3 07:12:29 UTC 2010 
State-Changed-Why:  
Thank you for your submission.  This issue has been solved in the upsteam and 
the current version of GS in the ports collection also has the fix.  If you 
noticed something wrong again, please let us know. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133641 
>Unformatted:
