[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xserver crashes (Re: bug in gnustep-make / my last mail (pantomime))

From: Nicola Pero
Subject: Re: Xserver crashes (Re: bug in gnustep-make / my last mail (pantomime))
Date: Fri, 27 Sep 2002 00:11:55 +0100 (BST)

Matthias, you also want to Cc: your X maintainer on Jeff's reply - it
seems Jeff knows much more than me on this matter :-)

Basically, font_cacher is just retrieving the list of fonts using
XListFonts(), then looping on them, and for each of them calling
XLoadQueryFont() [followed by a XFreeFont() before loading the next one,
so only one font should be loaded at any time].  This seems to be crashing
the X server.  Maybe we should ask on an XFree86 mailing what is the best
way to work around this problem, or when they think they are going to fix
the problem.

Maybe a workaround might be to use XListFontsWithInfo() [not sure if
possible for us] ?

(btw - totally unrelated - but gnustep-gui has the same problem, because
it never frees any NSFont object, so if you mechanically loop on all
NSFonts via gnustep-gui's API, you may well get out of memory, even if you
theoretically release all NSFonts correctly!  I have always said we need
to fix this, and NSFont objects *must* be destroyed and not kept around
forever :-)

>From address@hidden Fri Sep 27 00:03:52 2002
Date: Thu, 26 Sep 2002 03:17:47 -0400
From: Jeff Teunissen <address@hidden>
To: address@hidden
Subject: Re: bug in gnustep-make / my last mail (pantomime)

Nicola Pero wrote:

> > it seems, that all works well. The packages are built on hppa as well
> > (although I couldn't run them yet).
> Good
> > PS: The biggest problem is the Xserver crash now when building the
> > font cache.
> Yes - I can see that - I don't like myself the proposed workaround :-)
> but actually I can't see much of a way out.  I'd consider it a bug in
> the Xlib interface - you can only get either a single font, or the whole
> list of all possible fonts (and getting the whole list of fonts often
> requires more memory than available).  What is missing is an interface
> to loop on all the available fonts, returning a reasonable number (1 or
> 2 or 10) each time.

It's not a bug in Xlib, it's a problem in the X server.

XFree86 will happily give you the ability to have an effectively-infinite
number of fonts, and most people have more fonts installed than can be
used simultaneously. The problem is an optimization -- the X server
doesn't load a font until an app asks for information that can't be gotten
from the XLFD list (xlsfonts doesn't crash the server).

What's more, the server doesn't unload fonts after you're done with them,
on the assumption that you'll need them later.

font_cacher has the effect of loading all available fonts into memory, but
the X server doesn't have enough memory available to actually perform
this. The inevitable result is a crash.

Looping through them one at a time wouldn't change the result.

| Jeff Teunissen  -=-  Pres., Dusk To Dawn Computing  -=-  deek @
| GPG: 1024D/9840105A   7102 808A 7733 C2F3 097B  161B 9222 DAB8 9840 105A
| Core developer, The QuakeForge Project
| Specializing in Debian GNU/Linux    

Gnustep-dev mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]