Re: Xrender and 64bit

Matthieu Herrb <[email protected]>
Newsgroups gmane.comp.xfree86.devel
Organization CNRS/LAAS
Message-ID <[email protected]>
Michael wrote:
> Hello,
> 
> I recently found out that whoever wrote Xrender apparently didn't waste
> a single thought on 64bit systems. Base types are unsigned longs ( see
> X11/extensions/render.h ):
> 
> typedef unsigned long	Glyph;
> typedef unsigned long	GlyphSet;
> typedef unsigned long	Picture;
> typedef unsigned long	PictFormat;
> 
> but everything seems to assume they're size 4 bytes and goes some
> lengths to ensure 4 byte alignment but this still leads to occasional
> SIGBUS from Xserver/render/render.c, especially
> ProcRenderCompositeGlyph(). A quick, working but dead ugly 'fix' is
> this: 
> 
> Index: render.c
> =================================================================== 
> RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/render/render.c,v
> retrieving revision 1.1.1.6 diff -u -w -r1.1.1.6 render.c 
> --- render.c 18 Mar 2005 13:13:16 -0000      1.1.1.6 
> +++ render.c    24 Jul 2005 17:46:09 -0000 
> @@ -1300,7 +1300,7 @@
>         {
>             if (buffer + sizeof (GlyphSet) < end)
>             {
> -               gs = *(GlyphSet *) buffer;
> +               gs = *(CARD32 *) buffer;
>                 glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client,
>                                                                  gs,
>                                                			 GlyphSetType, 
> 
> A real fix would be to change the base types to something that's always
> 32bit I think but that would disrupt more or less everything that uses
> Xrender since they're exposed to clients.
> 
> Any ideas what to do about this? On sparc64 this leads to firefox
> occasionally crashing the Xserver and I'm pretty sure it would affect
> other 64bit architectures as well.
> 
> have fun
> Michael

FYI, this is the same problem as: 
<https://bugs.freedesktop.org/attachment.cgi?id=3095>
-- 
Matthieu Herrb
smime.p7s (application/x-pkcs7-signature, 3.9 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.