From owner-freebsd-x11@FreeBSD.ORG Wed Oct 8 08:30:13 2008 Return-Path: Delivered-To: freebsd-x11@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0408F10656AB for ; Wed, 8 Oct 2008 08:30:13 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E01278FC1B for ; Wed, 8 Oct 2008 08:30:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m988UCvf029868 for ; Wed, 8 Oct 2008 08:30:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m988UC6l029863; Wed, 8 Oct 2008 08:30:12 GMT (envelope-from gnats) Date: Wed, 8 Oct 2008 08:30:12 GMT Message-Id: <200810080830.m988UC6l029863@freefall.freebsd.org> To: freebsd-x11@FreeBSD.org From: "Dorr H. Clark" Cc: 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 Reply-To: "Dorr H. Clark" 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:30:13 -0000 The following reply was made to PR ports/122924; it has been noted by GNATS. From: "Dorr H. Clark" To: bug-followup@FreeBSD.org Cc: freebsd-x11@FreeBSD.org, freebsd-bugs@FreeBSD.org, "Mikhail T." Subject: Re: ports/122924: XCreateImage fails in most recent x11/XOrg Date: Wed, 8 Oct 2008 01:04:45 -0700 (PDT) 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