Bug 183536 - [patch] x11-fonts/fontconfig on armv6
Summary: [patch] x11-fonts/fontconfig on armv6
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Sean Bruno
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-31 19:40 UTC by Matthieu Volat
Modified: 2014-09-03 15:07 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu Volat 2013-10-31 19:40:05 UTC
x11-fonts/fontconfig was reported to segfault a while ago when built with clang on the arm architecture.

at the time, the proposed workaround was to build it with gcc, but this is not working anymore on freebsd 10 : lang/gcc is not buildable yet on the arm platform.

I've investigated the real problem, this is a segfault when calling the random() function in the FcRandom() function, located in src/fccompat.c

Fix: Here's another, not perfect but working, fix :



When applied, USE_GCC can be removed and fontconfig segfault is not obversable anymore.--K9wzq83hh4jYmikwXYL7udZCaPczWwAcQ4QHikc6s0q67jLp
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- src/fccompat.c.orig	2013-10-31 19:16:42.000000000 +0000
+++ src/fccompat.c	2013-10-31 19:15:57.000000000 +0000
@@ -182,7 +182,7 @@
     }
 
     random_r(&fcrandbuf, &result);
-#elif HAVE_RANDOM
+#elif HAVE_RANDOM && !defined(__arm__)
     static char statebuf[256];
     char *state;
     static FcBool initialized = FcFalse;
How-To-Repeat: => build fontconfig on arm target with freebsd 10
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-11-01 02:35:25 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gnome

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Sean Bruno freebsd_committer freebsd_triage 2014-09-02 14:39:34 UTC
Taking ticket.  I'll generate a patch for ports.
Comment 3 Sean Bruno freebsd_committer freebsd_triage 2014-09-03 12:02:11 UTC
https://reviews.freebsd.org/D716
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-09-03 14:58:31 UTC
A commit references this bug:

Author: sbruno
Date: Wed Sep  3 14:57:53 UTC 2014
New revision: 367209
URL: http://svnweb.freebsd.org/changeset/ports/367209

Log:
  Undiagnosed ARMv6 core dump occurs when using GCC with fontconfig.

  Avoid this crash and resore compiles via CLANG.

  PR:		183536
  Submitted by:	mazhe@alkumuna.eu
  Reviewed by:	kwm

Changes:
  head/x11-fonts/fontconfig/Makefile
  head/x11-fonts/fontconfig/files/patch-src__fccompat.c