[Bug 513582] segfault in FTC_CMapCache_Lookup()

bugzilla at redhat.com bugzilla at redhat.com
Fri Sep 25 05:39:18 UTC 2009


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.


https://bugzilla.redhat.com/show_bug.cgi?id=513582


mpsuzuki at hiroshima-u.ac.jp changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpsuzuki at hiroshima-u.ac.jp




--- Comment #23 from mpsuzuki at hiroshima-u.ac.jp  2009-09-25 01:39:16 EDT ---
As Kevin mentioned already, proposed fix has a side effect
that GCC finds a cast between incompatible pointers.
Although current git head of FreeType2 includes it,
I want to revert it.

In my investigation, the crashing behaviour was supposed to
be introduced by  Richard Guenther's inline optimizer for
GCC-4.4 branch, committed on 2008-08-09.
For detail, see https://savannah.nongnu.org/bugs/index.php?27441

I propose another fix to pass the problem, aslike:

diff --git a/src/cache/ftccache.h b/src/cache/ftccache.h
index 2082bc4..5e932b7 100644
--- a/src/cache/ftccache.h
+++ b/src/cache/ftccache.h
@@ -206,7 +206,7 @@ FT_BEGIN_HEADER
                                                                          \
                                                                          \
     error = 0;                                                           \
-    node  = NULL;                                                        \
+    /* node  = NULL; */                                                  \
     _idx  = _hash & _cache->mask;                                        \
     if ( _idx < _cache->p )                                              \
       _idx = _hash & ( _cache->mask*2 + 1 );                             \
@@ -246,7 +246,8 @@ FT_BEGIN_HEADER
     error = FTC_Cache_NewNode( _cache, _hash, query, &_node );           \
                                                                          \
   _Ok:                                                                   \
-    node = _node;                                                        \
+    _pnode = (FTC_Node*)(void*)&(node);                                  \
+    *_pnode = _node;                                                     \
   FT_END_STMNT

 #else /* !FTC_INLINE */

I want to revert the fix that current FC11 uses and apply
this patch. Anybody can test if this fix works well?

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.




More information about the Fedora-fonts-bugs-list mailing list