[Top][All Lists]

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

RE: [ft] Segfault in FT_Get_Name_Index, Solaris 9, FreeType 2.1.8+

From: Ian Brown
Subject: RE: [ft] Segfault in FT_Get_Name_Index, Solaris 9, FreeType 2.1.8+
Date: Wed, 17 May 2006 17:00:08 +0200

        I noticed that the orginal author says he sometimes gets a bus error. 
This indicates that he is running on a SPARC. On the SPARC architecture, you 
can only access 16 bit values on 16 bit address boundaries, 32 bit values on 32 
bit address boundaries etc. Whilst on an x86 violating this will result in a 
performance hit, on a SPARC (or PowerPC I think too) it will result in an 
exception called a Bus error.

It can often crop up when you write your own cache or memory manager. Malloc is 
guaranteed to always return chunks of memory aligned to 64 bit (or 128 bit 
depending on architecture) boundaries. The compiler guarantees correct 
alignment within structures themselves so everything is okay. If you write your 
own memory manager though and say return a pointer aligned to a 16 bit boundary 
(but not a 32 bit boundary) and then access, say, a 32 bit int from a structure 
stored there, you will get a bus error.

The above may not be relevant, but when trying to track down defects I find it 
is usually better to have too much information than too little.


-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of David Turner
Sent: 17 May 2006 16:11
To: Jan-Åke Larsson
Cc: address@hidden
Subject: Re: [ft] Segfault in FT_Get_Name_Index, Solaris 9, FreeType 2.1.8+


I've just tested it with FreeType CVS on a x86 Linux machine, and it 
seems to work
well with the font you sent me. Running with valgrind doesn't show any 
bad memory
access or other errors.

I don't have a Solaris 9 machine here, and won't be able to due much here.
Given the line were the segfault is detected, I suppose that the value 
of the
'service' variable is bogus (and not NULL).

In GDB, could you dump the content of face->internal->services and send it
to me, this would be a good start.


- David

PS: By the way, does the problem happens or even changes when compiling
      with/without optimizations ?

Jan-Åke Larsson a écrit :
> I get a segfault (or bus error, sometimes) from FT_Get_Name_Index on
> Solaris 9, with FreeType 2.1.8, 2.1.9 and 2.2.1. FreeType 2.1.7 works
> fine (but there, FT_LOAD_TARGET_LIGHT does not work)
> Steps to reproduce: Load font, map char name "d" to char index.
> Sometimes the map returns index 0, sometimes you get:
> ------------------------------------------------------------------------
> Program received signal SIGSEGV, Segmentation fault.
> 0xff319318 in FT_Get_Name_Index (face=0x1ed858, glyph_name=0x33548 "d")
>     at /home/jalar/build/freetype-2.1.8/src/base/ftobjs.c:2378
> 2378        if ( service && service->name_index )
> ------------------------------------------------------------------------
> I build 2.1.7 (working) and 2.1.8 (SIGSEGV) exactly the same way:
> ./configure --prefix=/home/jalar; gmake (uses gcc)
> Am I missing some advice for Solaris here?
> /Jan-Åke
> _______________________________________________
> Freetype mailing list
> address@hidden

Information contained in this email message is confidential and may be 
privileged, and is intended only for use of the individual or entity named 
above. If the reader of this message is not the intended recipient, or the 
employee or agent responsible to deliver it to the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the address@hidden and destroy the original 

Freetype mailing list

reply via email to

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