Bug 115893

Summary: ffmpeg-2007.07.12_3 graphics/php5-ffmpeg 0.5.0_2 --> libavcodec.so.1: Undefined symbol pthread_join in Unknown on line 0
Product: Ports & Packages Reporter: Andy Hilker <ah>
Component: Individual Port(s)Assignee: Jose Alonso Cardenas Marquez <acm>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Andy Hilker 2007-08-28 10:00:06 UTC
The php4-ffmpeg and php5-ffmpeg module used by apache20/php is broken.
It seems to be a pthread problem with ports/multimedia/ffmpeg.

Compile ports/multimedia/ffmpeg without -pthread or using ffmpeg-2007.05.30_1 still works.

httpd-error.log gives:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613/ffmpeg.so' - /usr/local/lib/libavcodec.so.1: Undefined symbol &quot;pthread_join&quot; in Un
known on line 0
[notice] Apache/2.0.59 (FreeBSD) PHP/5.2.3 with Suhosin-Patch mod_ssl/2.0.59 OpenSSL/0.9.8e configured -- resuming normal operations

Fix: 

Not a fix, maybe only a workaround or debug hint:

Compile ports/multimedia/ffmpeg without -pthread or using ffmpeg-2007.05.30_1 still works.
How-To-Repeat: cd /usr/ports/graphics/php5-ffmpeg
make install clean
(will install ports/multimedia/ffmpeg as a dependencie)
(same error with php4)

/usr/local/etc/rc.d/apache2.sh restart

will lead to an error in httpd-error.log:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613/ffmpeg.so' - /usr/local/lib/libavcodec.so.1: Undefined symbol &quot;pthread_join&quot; in Un
known on line 0
[notice] Apache/2.0.59 (FreeBSD) PHP/5.2.3 with Suhosin-Patch mod_ssl/2.0.59 OpenSSL/0.9.8e configured -- resuming normal operations
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-08-28 13:29:03 UTC
Responsible Changed
From-To: freebsd-ports-bugs->acm

Over to maintainer
Comment 2 marjo 2007-08-31 11:27:41 UTC
"Not a fix, maybe only a workaround or debug hint:
Compile ports/multimedia/ffmpeg without -pthread or using
ffmpeg-2007.05.30_1 still works."

 

How do I do this?
Comment 3 ahilker 2007-08-31 11:34:08 UTC
You (Marjo van Lier) wrote on Fri, Aug 31, 2007 at 12:27:41PM CEST:
> "Not a fix, maybe only a workaround or debug hint:
> Compile ports/multimedia/ffmpeg without -pthread or using
> ffmpeg-2007.05.30_1 still works."
> 
>  
> 
> How do I do this?

Edit the Makefile for the ffmpeg port and remove the --enable-pthreads
flag.  But I am not sure about unwanted effects of this "workaround".
Comment 4 marjo 2007-08-31 11:38:34 UTC
unwanted effects of this "workaround".??

What do you mean by this?

On 8/31/07, Andy Hilker <ahilker@inotronic.de> wrote:
>
> You (Marjo van Lier) wrote on Fri, Aug 31, 2007 at 12:27:41PM CEST:
> > "Not a fix, maybe only a workaround or debug hint:
> > Compile ports/multimedia/ffmpeg without -pthread or using
> > ffmpeg-2007.05.30_1 still works."
> >
> >
> >
> > How do I do this?
>
> Edit the Makefile for the ffmpeg port and remove the --enable-pthreads
> flag.  But I am not sure about unwanted effects of this "workaround".
>
Comment 5 Christos Chatzaras 2007-09-05 22:47:29 UTC
I have the same problem. Any idea when it will be fixed?
Comment 6 ahilker 2008-02-22 14:04:02 UTC
Found under http://groups.google.com/group/ffmpeg-php/ (topic:
Success compiling ffmpeg-php on freebsd ), tried and worked. Find
the patch for /usr/ports/graphics/php4-ffmpeg/Makefile below.

> I would recommend just adding -lpthread to the ffmpeg-php Makefile 
> after -lavcodec. The libavcodec doesn't link to the pthreads library 
> itself but rather expects that the binary linking to it will instead. 
> Adding the option to the makefile will make sure ffmpeg.so is linked 
> to pthreads and can therefore load the library when libavcodec makes 
> the call. 
> 
> Hope that helps! 


--- Makefile    Fri Feb 22 14:58:11 2008
+++ Makefile.fixed      Fri Feb 22 14:58:05 2008
@@ -27,6 +27,6 @@
 USE_PHPEXT=    yes
 IGNORE_WITH_PHP?=5
 DEFAULT_PHP_VER?=4
-CFLAGS+=       -I${LOCALBASE}/include -I${X11BASE}/include
+CFLAGS+=       -I${LOCALBASE}/include -I${X11BASE}/include -lpthread

 .include <bsd.port.mk>
Comment 7 ahilker 2008-02-25 14:22:20 UTC
Sorry, the last provided patch will trigger the "segfault on kill -HUP"
problem described in PR ports/120409.

The before described workaround by removing "--enable-pthreads" from
/usr/ports/multimedia/ffmpeg/Makefile still works.
Comment 8 Wesley Shields freebsd_committer freebsd_triage 2008-07-16 18:12:20 UTC
State Changed
From-To: open->closed

Closed in favor of ports/120409.