From owner-freebsd-x11@FreeBSD.ORG Wed Oct 8 08:21:33 2008 Return-Path: Delivered-To: freebsd-x11@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04E331065695; Wed, 8 Oct 2008 08:21:33 +0000 (UTC) (envelope-from dclark@engr.scu.edu) Received: from endor.engr.scu.edu (smtp.engr.scu.edu [129.210.16.13]) by mx1.freebsd.org (Postfix) with ESMTP id DC3808FC1A; Wed, 8 Oct 2008 08:21:32 +0000 (UTC) (envelope-from dclark@engr.scu.edu) Received: from nova41.dc.engr.scu.edu (nova41.dc.engr.scu.edu [129.210.16.38]) by endor.engr.scu.edu (8.13.6/8.13.6) with ESMTP id m9884lG2013239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Oct 2008 01:04:49 -0700 Received: from localhost (dclark@localhost) by nova41.dc.engr.scu.edu (8.13.6/8.13.6) with ESMTP id m9884kH7008234; Wed, 8 Oct 2008 01:04:46 -0700 (PDT) X-Authentication-Warning: nova41.dc.engr.scu.edu: dclark owned process doing -bs Date: Wed, 8 Oct 2008 01:04:45 -0700 (PDT) From: "Dorr H. Clark" X-Sender: dclark@nova41.dc.engr.scu.edu To: bug-followup@FreeBSD.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-x11@FreeBSD.org, freebsd-bugs@FreeBSD.org, "Mikhail T." Subject: Re: ports/122924: XCreateImage fails in most recent x11/XOrg X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Oct 2008 08:21:33 -0000 Bug Number 122924: XcreateImage fails in most recent x11/XOrg This is actually not a bug in FreeBSD, in fact during the investigation of this bug we were able to reproduce it on Linux (although at a higher level). To resolve a bug in XOrg file, we need to have the source files for XOrgalong with the mandatory external dependencies. Code changes have been made in file ImUtil.c in directory /usr/ports/distfiles/xorg/lib/libX11-1.1.3/src and at the bottom of this writeup is an explanation of how to retrieve the software needed for investigating this bug. The function XCreateImage takes image_bytes_per_line as one of the inputs. This parameter determines the value for Number of bytes between a pixel on one line and the pixel with the same X coordinate on the next line. In case the calling function sets this parameter to 0, XCreateImage calculates the minimum value for image_bytes_per_line depending upon the format of image and the required depth. Thus, if the input value for image_bytes_per_line is zero or less than the minimum value, it is set equal to the minimum value. Here is the patch: --- ImUtil_org.c 2008-08-21 12:46:15.000000000 +0000 +++ ImUtil.c 2008-08-21 12:47:37.000000000 +0000 @@ -372,10 +372,8 @@ min_bytes_per_line = ROUNDUP((width + offset), image->bitmap_pad); } - if (image_bytes_per_line == 0 ) { + if (image_bytes_per_line == 0 ||image_bytes_per_line < min_bytes_per_line ) { image->bytes_per_line = min_bytes_per_line; - } else if (image_bytes_per_line < min_bytes_per_line) { - return 0; } else { image->bytes_per_line = image_bytes_per_line; Shikha Bansal , engineer Dorr H. Clark, advisor Graduate School of Engineering Santa Clara University, Santa Clara CA http://www.cse.scu.edu/~dclark/coen_284_FreeBSD/122924.txt 1) GET THE XORG SOURCES a) cd /usr/ports/x11/xorg b) make (you must be connected to internet) This copies the source files into /usr/ports/distfiles 2) GET THE EXTERNAL DEPENDENCIES a) go to xcb.freedesktop.org/dist/ b) Download libxcb-0.9.93.tar.gz and xcb-proto-0.9.93.tar.gz in directory /usr/ports/distfiles/xorg/lib c) cd xcb-proto-0.9.93 d) make e) cp *.pc /usr/local/libdata/pkgconfig f) make install g) similarly install libxcb-0.9.93 3) INSTALL XORG AS A PORT a) cd /usr/ports/distfiles/xorg/lib/libX11-1.1.3/include b) mkdir xcb c) copy the following 4 headers from libxcb-0.9.93 to xcb folder created in previous step: xcb.h,xproto.h,xcbext.h,xcblib.h d) make install