Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » wierd segmentation fault when execute theide
Re: wierd segmentation fault when execute theide [message #9594 is a reply to message #8141] Fri, 18 May 2007 16:11 Go to previous message
tomek is currently offline  tomek
Messages: 1
Registered: May 2007
Junior Member
Hi,

I have very simlar error on my gentoo. I made some debug and here is result:

file: upp-2007.1/uppsrc/Draw/DrawTextXft.cpp
funciton:
static bool sCheckComposed(const char *face)


XftFontOpen() sometimes cannot open font, (in my case it is "ProFont" font) then it returns NULL. There is no checking so invalid pointer is used in XftCharExists() function.

Im not sure about logic of this function, but it should look like this to avoid segmentation fault:

static bool sCheckComposed(const char *face)
{
        XftFont *xftfont = XftFontOpen(Xdisplay, Xscreenno,
                                       XFT_FAMILY, XftTypeString, (char *)face,
                                       XFT_PIXEL_SIZE, XftTypeInteger, 20,
                                       (void *)0);
/// ---------
        if( xftfont == NULL )
                return false;
/// ---------
        int n = 0;
        for(int c = 0; c < 128; c++)
                if(!XftCharExists(Xdisplay, xftfont, c + 256))
                        n++;

        XftFontClose(Xdisplay, xftfont);
        return n > 10;
}


Probably font which cannot be opened should not be either collected by Draw::InitPlatformFonts() function.

Could someone fix it and provide new ebuild ?

When upp will be available in "standard" gentoo-portage tree?

Thanks,
Tom
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: assembly variable idea
Next Topic: small bug - more a mite :)
Goto Forum:
  


Current Time: Wed Jun 12 02:45:55 CEST 2024

Total time taken to generate the page: 0.02022 seconds