Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Apr 2014 00:06:36 GMT
From:      Alan Somers <asomers@freebsd.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/188741: devel/rubygem-ffi can't load libc on FreeBSD 10
Message-ID:  <201404180006.s3I06aEd030705@cgiserv.freebsd.org>
Resent-Message-ID: <201404180010.s3I0A0AR070653@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         188741
>Category:       ports
>Synopsis:       devel/rubygem-ffi can't load libc on FreeBSD 10
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 18 00:10:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Alan Somers
>Release:        10.0 RELEASE
>Organization:
Sp
>Environment:
FreeBSD newisys-1u-1 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
On FreeBSD 10.0, but not earlier versions, rubygem-ffi cannot load libc.so.  This bug is known upstream but not yet fixed.  The easiest way to demonstrate it is to cd to the ports directory and do "cd work/ffi-1.9.3; rake test".

Full details of the bug are at this link:
https://github.com/ffi/ffi/issues/308


>How-To-Repeat:
"cd work/ffi-1.9.3; rake test"
>Fix:
A patch (attached) is at this link:
https://github.com/Carpetsmoker/ffi/commit/ac63e07f76ed65e4ad8865ef1804ce6e7a333d19#diff-ff27654be928731017894d9ade3611a9

Patch attached with submission follows:

--- lib/ffi/library.rb.orig	2014-04-17 17:47:49.000000000 -0600
+++ lib/ffi/library.rb	2014-04-17 17:50:22.000000000 -0600
@@ -114,9 +114,9 @@
 
             rescue Exception => ex
               ldscript = false
-              if ex.message =~ /(([^ \t()])+\.so([^ \t:()])*):([ \t])*invalid ELF header/
-                if File.read($1) =~ /GROUP *\( *([^ \)]+) *\)/
-                  libname = $1
+              if ex.message =~ /(([^ \t()])+\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short|invalid file format)/
+                if File.read($1) =~ /(?:GROUP|INPUT) *\( *([^\)]+)/
+                  libname = $1.split(' ')[0]
                   ldscript = true
                 end
               end


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404180006.s3I06aEd030705>