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: Installation, Compiling and Running of theide » segmentation fault on Ubuntu Feisty
segmentation fault on Ubuntu Feisty [message #11368] Mon, 10 September 2007 12:22 Go to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
I've 2 pc both with ubuntu feisty installed.
On the first one, theide works great.
On the second, it don't even start, giving 'segmentation fault' with no other messages, IF RAN AS A NORMAL USER.
Running as ROOT does work.
I don't know where to look for the problem... any suggestion ?

Best Regards

Max

edit : running on GDB shows this :

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1219471664 (LWP 13303)]
0xb78538e5 in XftCharExists () from /usr/lib/libXft.so.2

edit : with the workaround here :

http://www.ultimatepp.org/forum/index.php?t=msg&goto=959 4&&srch=segmentation+fault#msg_9594

it does work.

Ciao

Max

[Updated on: Mon, 10 September 2007 12:43]

Report message to a moderator

Re: segmentation fault on Ubuntu Feisty [message #11381 is a reply to message #11368] Mon, 10 September 2007 18:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12122
Registered: November 2005
Ultimate Member
Can you check this little bit more evolved fix, please

static int 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 -1;
	int n = 0;
	for(int c = 0; c < 128; c++)
		if(!XftCharExists(Xdisplay, xftfont, c + 256))
			n++;
	XftFontClose(Xdisplay, xftfont);
	return n > 10;
}

void Draw::InitPlatformFonts()
{
	for(int i = 0; i < __countof(basic_fonts); i++) {
		XFTFontFaceInfo& f = XFTFontFace().Add(basic_fonts[i]);
		f.name = basic_fonts[i];
		f.scaleable = true;
		f.fixed = i == 3 || i == 6;
		f.compose = sCheckComposed(basic_fonts[i]);
	}
	FcFontSet *fs = XftListFonts(Xdisplay, Xscreenno, (void *)0, XFT_FAMILY, XFT_SPACING,
	                             XFT_SCALABLE, (void *)0);
	for(int i = 0; i < fs->nfont; i++) {
		FcChar8 *family = NULL;
		if(FcPatternGetString(fs->fonts[i], FC_FAMILY, 0, &family) == 0 && family) {
			int comp = sCheckComposed(face);
			if(comp >= 0) {
				XFTFontFaceInfo& f = XFTFontFace().GetAdd((char *)family);
				int spacing;
				if(FcPatternGetInteger(fs->fonts[i], FC_SPACING, 0, &spacing) == 0 && spacing == XFT_MONO)
					f.fixed = true;
				FcBool scaleable;
				if(FcPatternGetBool(fs->fonts[i], FC_SCALABLE, 0, &scaleable) == 0 && scaleable)
					f.scaleable = true;
				f.compose = comp;
			}
		}
	}
	FcFontSetDestroy(fs);
}


(The point is to not include fonts that fail into the list of fonts..)

Mirek
Re: segmentation fault on Ubuntu Feisty [message #11394 is a reply to message #11381] Mon, 10 September 2007 21:51 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
I'll test it tomorrow... here at home theide works with no patch !

Ciao

Max
Re: segmentation fault on Ubuntu Feisty [message #11402 is a reply to message #11394] Tue, 11 September 2007 11:12 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
'face' here is undefined :


int comp = sCheckComposed(face);


If I did understand the code (maybe not !) it must change like that :


int comp = sCheckComposed((char *)family);


Ciao

Max
Re: segmentation fault on Ubuntu Feisty [message #11419 is a reply to message #11402] Wed, 12 September 2007 11:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12122
Registered: November 2005
Ultimate Member
Thanks!

Mirek
Re: segmentation fault on Ubuntu Feisty [message #11421 is a reply to message #11368] Wed, 12 September 2007 11:51 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
thanx to you for the software ! Smile
Previous Topic: library sources missing on mandriva
Next Topic: Error compiling uvs sources on Ubuntu
Goto Forum:
  


Current Time: Wed Dec 11 02:00:26 CET 2019

Total time taken to generate the page: 0.02866 seconds