Bug 2107144 - xblast-x11 crashes with "BadFont (invalid Font parameter)" after usig xblast-sdl
Summary: xblast-x11 crashes with "BadFont (invalid Font parameter)" after usig xblast-sdl
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: xblast
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Hans de Goede
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-14 12:43 UTC by Petr Pisar
Modified: 2022-07-18 09:23 UTC (History)
1 user (show)

Fixed In Version: xblast-2.10.4-35.fc37
Clone Of:
Environment:
Last Closed: 2022-07-16 15:55:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Petr Pisar 2022-07-14 12:43:13 UTC
If you start xblast-x11 after using xblast-sdl, xblast-x11 crashed on start like this:

$ xblast-x11 
could not load font 24
could not load font 18
could not load font 14
X Error of failed request:  BadFont (invalid Font parameter)
  Major opcode of failed request:  56 (X_ChangeGC)
  Resource id in failed request:  0x0
  Serial number of failed request:  501
  Current serial number in output stream:  524

The reason is that xblast-sdl stores into ~/.xblast_tnt/config/x11.cfg:

[font]
large=24
medium=18
small=14

and then xblast-x11 reuses that font settings and passes the numbers to XLoadQueryFont() in LoadFont() in x11c_text.c. That obviously fails because X11 does not expect a font size number "24", but na X11 font pattern "-*-helvetica-bold-r-*-*-24-*-*-*-*-*-iso8859-*" as defined in defaultFontConfig array.

Affected package is xblast-x11-2.10.4-34.fc36.x86_64.
The easiest way to reproduce it is to delete ~/.xblast_tnt before starting the two programs.

I believe that a proper fix is separating the two font configurations. One for X11 and another for SDL.

Comment 1 Hans de Goede 2022-07-16 15:55:13 UTC
> I believe that a proper fix is separating the two font configurations. One for X11 and another for SDL.

Right. Thank you for reporting this and thank you for the analysis of the problem.

I've just prepared an update (for rawhide only since normal users are unlike to hit this) which:

1. Changes the SDL build to use ~/.xblast_tnt/config/sdl.cfg as config file for the font settings
2. Changes the X11 config loading code to recognize the broken settings and have it fallback to the defaults in that case


Note You need to log in before you can comment on or make changes to this bug.