FLTK logo

STR #1660

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]

Return to Bugs & Features | Roadmap 2.0 | Post Text | Post File | SVN ⇄ GIT ]

STR #1660

Application:FLTK Library
Status:5 - New
Priority:4 - High, e.g. key functionality not working
Scope:2 - Specific to an operating system
Summary:Xft font listing is broken on X11
Created By:gga
Assigned To:Unassigned
Fix Version:2.0-current
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]

No files

Trouble Report Comments:

Post Text ]
Name/Time/Date Text  
#1 gga
17:20 Apr 23, 2007
Getting the list of encodings or the list of font sizes leads to a crash.
The crashing function is XftListFonts.
Crash does not happen if the query is changed, from, say:

  fs = XftListFonts(xdisplay, xscreen,
                    XFT_FAMILY, XftTypeString, name_, 0,
                    XFT_ENCODING, 0);


  fs = XftListFonts(xdisplay, xscreen,
                    XFT_FAMILY, XftTypeString, name_, 0,
                    XFT_ENCODING, XFT_FAMILY, 0);

but still I get no encodings.

fltk::Font::encodings(const char**& arrayp)

has a bug in that it incorrectly sets a static variable
XftFontSet* fs without initializing it (and this gets destroyed afterwards).  However, this is not the source of the crash for me.
#2 sanel.z
06:06 Jun 01, 2007
XftListFonts will return allocated variable.

Still crashing ? (if does, can you give when, please :))
#3 gga
07:54 Jun 01, 2007
Read the original comment.  It crashes when getting either the list of encodings or the list of sizes on X11.
The list of encodings function (IIRC) has a bug where a static is not initialized to zero, but that's not the source of the crash.
I also compared the code to the 1.0 branch and they were identical (down to even the bug of the uninitialized static variable), so my guess is that the bug is either on both, or the bug is present on 2.0 but it is related to some other uninitialized variable somewhere else out there.
I am no expert on X11 or Xft, but as far as I could tell, the functions are being called correctly (I think I also compared the code against xlsfonts which is the Xft demo for listing stuff, IIRC).
I also run the code under valgrind with no report (albeit valgrind will not catch any static variables or auto variable memory overruns).
#4 sanel.z
08:09 Jun 05, 2007
> Read the original comment
I'm reading it, and can't crash anything here :) Check again, _does_ font demo crashes (it is calling Font::encoding()); if does not, bug is not in fltk :P

Can you post your crashing sample ?

> so my guess is that the bug is either on both
No one reported for 1.1.x yet.
#5 sanel.z
09:40 Jun 05, 2007
Uh, soory, I didn't noticed str #1570 (due noise here :)).

Can you try to compile fltk without xft; crashes repeats ?
#6 ianmacarthur
12:02 Jul 16, 2007
I can't comment on fltk2, but gga says the fltk-1.1 code is basically the same - I've been using that a lot recently and am not seeing any crashes... Also, I wrote a lot of the xft code in fltk-1.1 so I'm interested in this...

Anyway - (gga) do you see the same crash running fltk1.1.x?
Also, you say there's an uninitialised static - can you send me a note of exactly where you are concerned, and I'll try and take a look.
#7 gga
07:07 Jul 20, 2007
Well, looking a little bit more into it, it seems more like the actual fltk font demo program is broken, as it trashes memory right and left.

I wrote my own little routine to list stuff, it all seemed to work.

So I think this bug report has to be changed to be more like the "font demo program is broken", not x11's font listing is broken.
#8 isaque
12:35 Oct 13, 2009
It's been two+ years now.

Can we close this?

Return to Bugs & Features | Post Text | Post File ]


Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.