[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#181815: marked as done (xlibs: [Xrender] bad length computation in XRenderCompositeString16()/XRenderCompositeString32())



Your message dated Sun, 11 May 2003 12:56:53 -0400
with message-id <E19Eu85-0005EA-00@auric.debian.org>
and subject line Bug#181815: fixed in xrender 0.8.1-1
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 20 Feb 2003 21:30:55 +0000
>From anthony@thizlinux.com Thu Feb 20 15:30:54 2003
Return-path: <anthony@thizlinux.com>
Received: from (anthony) [210.3.115.98] (mail)
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 18lyHN-0001nZ-00; Thu, 20 Feb 2003 15:30:53 -0600
Received: from foka by anthony with local (Exim 3.36 #1 (Debian))
	id 18lyKE-0008Dk-00; Fri, 21 Feb 2003 05:33:50 +0800
Content-Type: multipart/mixed; boundary="===============86660630500512581=="
MIME-Version: 1.0
From: Anthony Fok <foka@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: xlibs: Problem with XRenderCompositeText16 in Render extension
X-Mailer: reportbug 2.10
Date: Fri, 21 Feb 2003 05:33:50 +0800
Message-Id: <E18lyKE-0008Dk-00@anthony>
Sender: Anthony Fok <anthony@thizlinux.com>
X-MailScanner: Found to be clean
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-0.2 required=4.0
	tests=HAS_PACKAGE,SPAM_PHRASE_00_01
	version=2.44
X-Spam-Level: 

This is a multi-part MIME message sent by reportbug.

--===============86660630500512581==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: xlibs
Version: 4.2.1-5
Severity: important
Tags: patch upstream sid

Hello Branden,

Mozilla Xft users (including myself) have been experiencing strange
disappearing text problem, as explained in Mozilla Bugzilla "Bug
#187377: Characters disappear with xft if fallback triggered twice on
the same line" and related bug reports.  See:

    http://bugzilla.mozilla.org/show_bug.cgi?id=187377

Most bug reporters use Debian or FreeBSD.  This problem does not happen
on Red Hat 8.0.  I guess not many people know the fix yet.

The details of this bug came up on the XFree86 fonts mailing list just
two days ago:

  ITO Tsuyoshi says:

    While performing some test about Mozilla Bugzilla Bug #187377 [1], I
    found that XRenderCompositeText16 function in Render extension does
    not draw text as intended when multiple glyphsets are involved in one
    call.

    According to the code of the Render extension on X server side,
    XRenderCompositeText16 should send a "glyphset-switch sign" (a glyph
    element with len = 0xff) to the X server when it encounters a glyph
    element whose glyphset is different from the one of the previous glyph
    element.  However, it actually sends the glyphset-switch sign when it
    encounters a glyph element whose glyphset is different from the one of
    the _first_ glyph element.  XRenderCompositeText{8,32} probably have
    the same problem.

  and provided a patch.  Keith Packard replied:

    Your analysis is quite correct.  A fix solving this issue was placed in
    XFree86 CVS on 2002-8-31.

That patch was also included in Red Hat 8.0, probably days before it
was final:

  * Sun Sep 01 2002 Mike A. Harris <mharris@redhat.com> 4.2.0-70
  ...
  - Added XFree86-4.2.0-libXrender-bugfix.patch to fix showstopper (#73243)

That patch (still identical to the one in current XFree86-4.3 CVS) is
attached.  Please include this in your next upload.  (Feel free to change
the "094_" number.  :-)

Thanks!

Anthony

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux anthony 2.4.21-pre4-ac1 #1 Mon Feb 3 03:11:48 HKT 2003 i686

Versions of packages xlibs depends on:
ii  libc6                         2.3.1-12   GNU C Library: Shared libraries an
ii  libfreetype6                  2.1.3-10   FreeType 2 font engine, shared lib
ii  xfree86-common                4.2.1-5    X Window System (XFree86) infrastr

-- no debconf information


--===============86660630500512581==
Content-Type: text/x-c; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="/tmp/094_libXrender_bugfix.diff"

Index: lib/Xrender/Glyph.c
===================================================================
RCS file: /cvs/xc/lib/Xrender/Glyph.c,v
retrieving revision 1.7
retrieving revision 1.10
diff -u -p -r1.7 -r1.10
--- xc/lib/Xrender/Glyph.c	2001/12/27 01:16:00	1.7
+++ xc/lib/Xrender/Glyph.c	2002/08/31 18:15:45	1.10
@@ -125,6 +125,7 @@ XRenderFreeGlyphs (Display   *dpy,
     GetReq(RenderFreeGlyphs, req);
     req->reqType = info->codes->major_opcode;
     req->renderReqType = X_RenderFreeGlyphs;
+    req->glyphset = glyphset;
     len = nglyphs;
     SetReqLen(req, len, len);
     len <<= 2;
@@ -390,6 +391,7 @@ XRenderCompositeText8 (Display			    *dp
 {
     XExtDisplayInfo		*info = XRenderFindDisplay (dpy);
     xRenderCompositeGlyphs8Req	*req;
+    GlyphSet			glyphset;
     long			len;
     long			elen;
     xGlyphElt			*elt;
@@ -419,10 +421,17 @@ XRenderCompositeText8 (Display			    *dp
      */
     len = 0;
     
+    glyphset = elts[0].glyphset;
     for (i = 0; i < nelt; i++)
     {
-	if (elts[i].glyphset != req->glyphset)
+	/*
+	 * Check for glyphset change
+	 */
+	if (elts[i].glyphset != glyphset)
+	{
+	    glyphset = elts[i].glyphset;
 	    len += (SIZEOF (xGlyphElt) + 4) >> 2;
+	}
 	nchars = elts[i].nchars;
 	/*
 	 * xGlyphElt must be aligned on a 32-bit boundary; this is
@@ -434,26 +443,24 @@ XRenderCompositeText8 (Display			    *dp
     }
     
     req->length += len;
-    /* 
-     * If the entire request does not fit into the remaining space in the
-     * buffer, flush the buffer first.
-     */
 
-    if (dpy->bufptr + (len << 2) > dpy->bufmax)
-    	_XFlush (dpy);
-
+    /*
+     * Send the glyphs
+     */
+    glyphset = elts[0].glyphset;
     for (i = 0; i < nelt; i++)
     {
 	/*
 	 * Switch glyphsets
 	 */
-	if (elts[i].glyphset != req->glyphset)
+	if (elts[i].glyphset != glyphset)
 	{
+	    glyphset = elts[i].glyphset;
 	    BufAlloc (xGlyphElt *, elt, SIZEOF (xGlyphElt));
 	    elt->len = 0xff;
 	    elt->deltax = 0;
 	    elt->deltay = 0;
-	    Data32(dpy, &elts[i].glyphset, 4);
+	    Data32(dpy, &glyphset, 4);
 	}
 	nchars = elts[i].nchars;
 	xDst = elts[i].xOff;
@@ -461,15 +468,17 @@ XRenderCompositeText8 (Display			    *dp
 	chars = elts[i].chars;
 	while (nchars)
 	{
+	    int this_chars = nchars > MAX_8 ? MAX_8 : nchars;
+
 	    BufAlloc (xGlyphElt *, elt, SIZEOF(xGlyphElt))
-	    elt->len = nchars > MAX_8 ? MAX_8 : nchars;
+	    elt->len = this_chars;
 	    elt->deltax = xDst;
 	    elt->deltay = yDst;
 	    xDst = 0;
 	    yDst = 0;
-	    Data (dpy, chars, elt->len);
-	    nchars -= elt->len;
-	    chars += elt->len;
+	    Data (dpy, chars, this_chars);
+	    nchars -= this_chars;
+	    chars += this_chars;
 	}
     }
     
@@ -492,6 +501,7 @@ XRenderCompositeText16 (Display			    *d
 {
     XExtDisplayInfo		*info = XRenderFindDisplay (dpy);
     xRenderCompositeGlyphs16Req	*req;
+    GlyphSet			glyphset;
     long			len;
     long			elen;
     xGlyphElt			*elt;
@@ -521,10 +531,17 @@ XRenderCompositeText16 (Display			    *d
      */
     len = 0;
     
+    glyphset = elts[0].glyphset;
     for (i = 0; i < nelt; i++)
     {
-	if (elts[i].glyphset != req->glyphset)
+	/*
+	 * Check for glyphset change
+	 */
+	if (elts[i].glyphset != glyphset)
+	{
+	    glyphset = elts[i].glyphset;
 	    len += (SIZEOF (xGlyphElt) + 4) >> 2;
+	}
 	nchars = elts[i].nchars;
 	/*
 	 * xGlyphElt must be aligned on a 32-bit boundary; this is
@@ -536,26 +553,21 @@ XRenderCompositeText16 (Display			    *d
     }
     
     req->length += len;
-    /* 
-     * If the entire request does not fit into the remaining space in the
-     * buffer, flush the buffer first.
-     */
 
-    if (dpy->bufptr + (len << 2) > dpy->bufmax)
-    	_XFlush (dpy);
-
+    glyphset = elts[0].glyphset;
     for (i = 0; i < nelt; i++)
     {
 	/*
 	 * Switch glyphsets
 	 */
-	if (elts[i].glyphset != req->glyphset)
+	if (elts[i].glyphset != glyphset)
 	{
+	    glyphset = elts[i].glyphset;
 	    BufAlloc (xGlyphElt *, elt, SIZEOF (xGlyphElt));
 	    elt->len = 0xff;
 	    elt->deltax = 0;
 	    elt->deltay = 0;
-	    Data32(dpy, &elts[i].glyphset, 4);
+	    Data32(dpy, &glyphset, 4);
 	}
 	nchars = elts[i].nchars;
 	xDst = elts[i].xOff;
@@ -563,15 +575,18 @@ XRenderCompositeText16 (Display			    *d
 	chars = elts[i].chars;
 	while (nchars)
 	{
+	    int this_chars = nchars > MAX_16 ? MAX_16 : nchars;
+	    int this_bytes = this_chars * 2;
+    
 	    BufAlloc (xGlyphElt *, elt, SIZEOF(xGlyphElt))
-	    elt->len = nchars > MAX_16 ? MAX_16 : nchars;
+	    elt->len = this_chars;
 	    elt->deltax = xDst;
 	    elt->deltay = yDst;
 	    xDst = 0;
 	    yDst = 0;
-	    Data16 (dpy, chars, elt->len * 2);
-	    nchars -= elt->len;
-	    chars += elt->len;
+	    Data16 (dpy, chars, this_bytes);
+	    nchars -= this_chars;
+	    chars += this_chars;
 	}
     }
     
@@ -594,6 +609,7 @@ XRenderCompositeText32 (Display			    *d
 {
     XExtDisplayInfo		*info = XRenderFindDisplay (dpy);
     xRenderCompositeGlyphs32Req	*req;
+    GlyphSet			glyphset;
     long			len;
     long			elen;
     xGlyphElt			*elt;
@@ -607,6 +623,7 @@ XRenderCompositeText32 (Display			    *d
     RenderSimpleCheckExtension (dpy, info);
     LockDisplay(dpy);
 
+    
     GetReq(RenderCompositeGlyphs32, req);
     req->reqType = info->codes->major_opcode;
     req->renderReqType = X_RenderCompositeGlyphs32;
@@ -623,36 +640,38 @@ XRenderCompositeText32 (Display			    *d
      */
     len = 0;
     
+    glyphset = elts[0].glyphset;
     for (i = 0; i < nelt; i++)
     {
-	if (elts[i].glyphset != req->glyphset)
+	/*
+	 * Check for glyphset change
+	 */
+	if (elts[i].glyphset != glyphset)
+	{
+	    glyphset = elts[i].glyphset;
 	    len += (SIZEOF (xGlyphElt) + 4) >> 2;
+	}
 	nchars = elts[i].nchars;
 	elen = SIZEOF(xGlyphElt) * ((nchars + MAX_32) / MAX_32) + nchars *4;
 	len += (elen + 3) >> 2;
     }
     
     req->length += len;
-    /* 
-     * If the entire request does not fit into the remaining space in the
-     * buffer, flush the buffer first.
-     */
-
-    if (dpy->bufptr + (len << 2) > dpy->bufmax)
-    	_XFlush (dpy);
 
+    glyphset = elts[0].glyphset;
     for (i = 0; i < nelt; i++)
     {
 	/*
 	 * Switch glyphsets
 	 */
-	if (elts[i].glyphset != req->glyphset)
+	if (elts[i].glyphset != glyphset)
 	{
+	    glyphset = elts[i].glyphset;
 	    BufAlloc (xGlyphElt *, elt, SIZEOF (xGlyphElt));
 	    elt->len = 0xff;
 	    elt->deltax = 0;
 	    elt->deltay = 0;
-	    Data32(dpy, &elts[i].glyphset, 4);
+	    Data32(dpy, &glyphset, 4);
 	}
 	nchars = elts[i].nchars;
 	xDst = elts[i].xOff;
@@ -660,15 +679,17 @@ XRenderCompositeText32 (Display			    *d
 	chars = elts[i].chars;
 	while (nchars)
 	{
+	    int this_chars = nchars > MAX_32 ? MAX_32 : nchars;
+	    int this_bytes = this_chars * 4;
 	    BufAlloc (xGlyphElt *, elt, SIZEOF(xGlyphElt))
-	    elt->len = nchars > MAX_32 ? MAX_32 : nchars;
+	    elt->len = this_chars;
 	    elt->deltax = xDst;
 	    elt->deltay = yDst;
 	    xDst = 0;
 	    yDst = 0;
-	    Data32 (dpy, chars, elt->len * 4);
-	    nchars -= elt->len;
-	    chars += elt->len;
+	    Data32 (dpy, chars, this_bytes);
+	    nchars -= this_chars;
+	    chars += this_chars;
 	}
     }
     

--===============86660630500512581==--

---------------------------------------
Received: (at 181815-close) by bugs.debian.org; 11 May 2003 17:03:28 +0000
>From troup@auric.debian.org Sun May 11 12:03:27 2003
Return-path: <troup@auric.debian.org>
Received: from auric.debian.org [206.246.226.45] (mail)
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 19EuER-0000d3-00; Sun, 11 May 2003 12:03:27 -0500
Received: from troup by auric.debian.org with local (Exim 3.35 1 (Debian))
	id 19Eu85-0005EA-00; Sun, 11 May 2003 12:56:53 -0400
From: Branden Robinson <branden@debian.org>
To: 181815-close@bugs.debian.org
X-Katie: lisa $Revision: 1.23 $
Subject: Bug#181815: fixed in xrender 0.8.1-1
Message-Id: <E19Eu85-0005EA-00@auric.debian.org>
Sender: James Troup <troup@auric.debian.org>
Date: Sun, 11 May 2003 12:56:53 -0400
Delivered-To: 181815-close@bugs.debian.org

We believe that the bug you reported is fixed in the latest version of
xrender, which is due to be installed in the Debian FTP archive:

libxrender-dev_0.8.1-1_powerpc.deb
  to pool/main/x/xrender/libxrender-dev_0.8.1-1_powerpc.deb
libxrender1-dbg_0.8.1-1_powerpc.deb
  to pool/main/x/xrender/libxrender1-dbg_0.8.1-1_powerpc.deb
libxrender1_0.8.1-1_powerpc.deb
  to pool/main/x/xrender/libxrender1_0.8.1-1_powerpc.deb
xrender_0.8.1-1.diff.gz
  to pool/main/x/xrender/xrender_0.8.1-1.diff.gz
xrender_0.8.1-1.dsc
  to pool/main/x/xrender/xrender_0.8.1-1.dsc
xrender_0.8.1.orig.tar.gz
  to pool/main/x/xrender/xrender_0.8.1.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 181815@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Branden Robinson <branden@debian.org> (supplier of updated xrender package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sun,  4 May 2003 13:14:54 -0500
Source: xrender
Binary: libxrender1-dbg libxrender-dev libxrender1
Architecture: source powerpc
Version: 0.8.1-1
Distribution: unstable
Urgency: low
Maintainer: Branden Robinson <branden@debian.org>
Changed-By: Branden Robinson <branden@debian.org>
Description: 
 libxrender-dev - X Rendering Extension client library (development files)
 libxrender1 - X Rendering Extension client library
 libxrender1-dbg - X Rendering Extension client library (unstripped)
Closes: 181815
Changes: 
 xrender (0.8.1-1) unstable; urgency=low
 .
   * initial release
     + fix bad length computation in
       XRenderCompositeString16()/XRenderCompositeString32() that caused
       application crashes with BadValue X protocol errors, particularly in
       gnome-terminal and mozilla-xft (Closes: #181815)
 .
   * {Makefile.am,xrender.pc.in}: Upstream hasn't quite gotten rid of its
     libXext dependency yet; Xrenderint.h still makes reference to
     XMissingExtension().  Therefore, Xrender itself, and objects that link
     against libXrender, should also link against libXext.
   * {Makefile.in,aclocal.m4,config.guess,config.sub,configure}: regenerated
     with automake 1.7.4 and friends
 .
   * Until XFree86 4.3.0 is released to Debian unstable:
     - the libxrender1 package will depend on xlibs (>> 4.2.1) and dpkg-divert
       its libXrender.so.1 symlink
     - the libxrender1-dbg package will depend on xlibs-dbg (>> 4.2.1) and
       dpkg-divert its libXrender.so.1 symlink
     - the libxrender-dev package will depend on xlibs-dev (>> 4.2.1) and
       dpkg-divert its libXrender.a file, libXrender.so symlink, and Xrender.h
       file
Files: 
 10358413e90c9825cdd838b15f7604c4 644 x11 optional xrender_0.8.1-1.dsc
 38b85aba468cff0aa0cde7339b58d5b6 212079 x11 optional xrender_0.8.1.orig.tar.gz
 a051b9b82d9d8894873f08ae993003a0 7218 x11 optional xrender_0.8.1-1.diff.gz
 ddb34895e64e85c13d8d660158eb46ec 19072 libs optional libxrender1_0.8.1-1_powerpc.deb
 5d5c850912bdecbb56619b1c4e4dbe18 310924 libdevel optional libxrender1-dbg_0.8.1-1_powerpc.deb
 d0e6723fa7b7596553ee79c72a21124d 21490 libdevel optional libxrender-dev_0.8.1-1_powerpc.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iEYEARECAAYFAj61WtEACgkQ6kxmHytGonx14ACfUXCMH5054dITcr2mnQlVVMmW
hN8An2yYlquFVVJyMIpwSbbFCjn8f5n4
=mcQu
-----END PGP SIGNATURE-----




Reply to: