Unexpected BadValue for X_OpenFont

Jeremy Huddleston jeremyhu at freedesktop.org
Mon Sep 27 11:41:23 PDT 2010


On Sep 27, 2010, at 08:42, Adam Jackson wrote:

> 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
...
>> 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.

Yeah, it's a BadFontFormat (88).  The (*scalable->renderer->OpenScalable) call is returning the BadFontFormat.

Enabling DEBUG_TRUETYPE in ft.h (and fixing the XLFD printing bug) printed out:
Open Scalable /System/Library/Fonts/ZapfDingbats.ttf, XLFD=-misc-zapf dingbats-medium-r-normal--0-0-0-0-p-0-iso10646-1
Closing face: /System/Library/Fonts/ZapfDingbats.ttf
Error during load: 88

So it's happening inside FreeTypeLoadXFont which in turn got it from FreeTypeLoadFont which in turn got it from FTPickMapping.

gdb is being a PITA and not finding debug symbols, so I can't step through, but it looks like something in FTPickMapping doesn't agree with the font.





More information about the xorg-devel mailing list