Unexpected BadValue for X_OpenFont

Adam Jackson ajax at nwnk.net
Mon Sep 27 08:42:04 PDT 2010


On Sun, 2010-09-26 at 22:52 -0700, Jeremy Huddleston wrote:
> I filed this a while ago
> (https://bugs.freedesktop.org/show_bug.cgi?id=28803) for a user who
> reported it to me through XQuartz
> (http://xquartz.macosforge.org/trac/ticket/325) since I'm pretty
> clueless about a bunch of font magic.  Since I finally have time to
> work through my XQuartz queue, I thought I'd bring it up and hopefully
> make some progress...

Oh good, core fonts.  My favorite.

> You'll get:
> X Error of failed request:  BadValue (integer parameter out of range
> for
> operation)
>   Major opcode of failed request:  45 (X_OpenFont)
>   Value in failed request:  0x80000b
>   Serial number of failed request:  21
>   Current serial number in output stream:  22

The only obvious place I can see in the ProcOpenFont path where you
could get a BadValue out is in doOpenFont:

        err = (*fpe_functions[fpe->type].open_font)
            ((pointer) client, fpe, c->flags,
             c->fontname, c->fnamelen, FontFormat,
             BitmapFormatMaskByte |
             BitmapFormatMaskBit |
             BitmapFormatMaskImageRectangle |
             BitmapFormatMaskScanLinePad |
             BitmapFormatMaskScanLineUnit,
             c->fontid, &pfont, &alias,
             c->non_cachable_font && c->non_cachable_font->fpe == fpe ?
                 c->non_cachable_font :
                 (FontPtr)0);

So that ends up being FontFileOpenFont() in libXfont, then it's all a
maze of twisty passages.  Remember that font error types are different
from X error types, so we consult FontToXError() and discover that any
of BadFontPath, BadFontFormat, or BadCharRange could become BadValue.
As a first cut I'd hack FontToXError to have those all return different
things (something you can't otherwise generate like BadWindow and
BadPixmap for two of them should be enough), that should help us drill
down.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100927/5f55a370/attachment.pgp>


More information about the xorg-devel mailing list