Bug 187181

Summary: sysutils/php5-fileinfo causes PHP and Apache to core dump
Product: Ports & Packages Reporter: Patrick Proniewski <patpro>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed Feedback Timeout    
Severity: Affects Only Me CC: miwi
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Patrick Proniewski 2014-03-01 21:40:00 UTC
On an Apache server, with mod_php 5.4.25, calls to fileinfo functions make php and apache crash with signals 10 and 11

How-To-Repeat: install lang/php5 and add php5-fileinfo-5.4.25. You should by default have at least few php extensions installed. I have those loaded into extensions.ini:

$ cat extensions.ini
extension=posix.so
extension=session.so
extension=http.so
extension=intl.so
extension=iconv.so
extension=hash.so
extension=fileinfo.so

Write a short php program (test.php):

<?php
$fi = new finfo(FILEINFO_MIME);
echo $fi->file('/path/to/local/file');
?>

Run it:

$ php -n --php-ini ./extensions.ini -f test.php 
Segmentation fault: 11 (core dumped)

If I comment either "extension=intl.so" or "extension=http.so", php won't crash:

$ cat extensions.ini 
extension=posix.so
extension=session.so
extension=http.so
;extension=intl.so
extension=iconv.so
extension=hash.so
extension=fileinfo.so

$ php -n --php-ini ./extensions.ini -f test.php 
image/jpeg; charset=binary
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-03-02 03:27:21 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Alex Dupre freebsd_committer freebsd_triage 2014-06-03 10:42:53 UTC
Do you still have the issue? Try changing the load order of fileinfo extension in extensions.ini.