ID: 46331
Updated by: [EMAIL PROTECTED]
Reported By: Bjorn dot Wiberg at its dot uu dot se
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: IBM AIX 5.3 (5300-08-01-0819)
PHP Version: 5.3CVS-2008-10-17 (snap)
New Comment:
Any chance of a full backtrace?
bt full
I can't reproduce this on OS X or CentOS.
Previous Comments:
------------------------------------------------------------------------
[2008-10-17 14:57:30] Bjorn dot Wiberg at its dot uu dot se
Description:
------------
The (5.3dev200810170630) bundled Fileinfo extension does not look for
/usr/share/misc/magic{.*} as suggested by
http://se.php.net/manual/en/function.finfo-open.php.
Setting the environment variable MAGIC works, however.
So does specifying the full path to to magic file in the call to
finfo_open().
When it fails to find the magic file, PHP core dumps.
Reproduce code:
---------------
php -d
extension_dir=/apache/php/lib/php/extensions/debug-non-zts-20071006 -r
'$finfo=finfo_open(FILEINFO_MIME);'
Also see "Actual result" below, which illustrates all this.
Expected result:
----------------
No coredump,
Actual result:
--------------
[EMAIL PROTECTED]:/# /nynom/apache/php/bin/php -d
extension_dir=/nynom/apache/php/lib/php/extensions/debug-non-zts-20071006
-r '$finfo=finfo_open(FILEINFO_MIME);'
Segmentation fault (core dumped)
[EMAIL PROTECTED]:/# gdb /nynom/apache/php/bin/php ./core
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "powerpc-ibm-aix5.1.0.0"...
Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
#0 0x107ca694 in bs1 (Illegal instruction (core dumped)
[EMAIL PROTECTED]:/# /nynom/apache/php/bin/php -d
extension_dir=/nynom/apache/php/lib/php/extensions/debug-non-zts-20071006
-r '$finfo=finfo_open(FILEINFO_MIME, "/usr/local/share/file/magic");'
(OK)
[EMAIL PROTECTED]:/# export MAGIC=/usr/local/share/file/magic
[EMAIL PROTECTED]:/# /nynom/apache/php/bin/php -d
extension_dir=/nynom/apache/php/lib/php/extensions/debug-non-zts-20071006
-r '$finfo=finfo_open(FILEINFO_MIME);'
[EMAIL PROTECTED]:/#
(OK)
[EMAIL PROTECTED]:/# cd /usr/share/
[EMAIL PROTECTED]:/usr/share# mkdir misc
[EMAIL PROTECTED]:/usr/share# cd misc/
[EMAIL PROTECTED]:/usr/share/misc# ln -s /usr/local/share/file/magic* .
[EMAIL PROTECTED]:/usr/share/misc# ls -l
total 0
lrwxrwxrwx 1 root system 27 2008-10-17 16:52 magic ->
/usr/local/share/file/magic
lrwxrwxrwx 1 root system 31 2008-10-17 16:52 magic.mgc ->
/usr/local/share/file/magic.mgc
lrwxrwxrwx 1 root system 32 2008-10-17 16:52 magic.mime ->
/usr/local/share/file/magic.mime
lrwxrwxrwx 1 root system 36 2008-10-17 16:52 magic.mime.mgc ->
/usr/local/share/file/magic.mime.mgc
[EMAIL PROTECTED]:/usr/share/misc# cd
[EMAIL PROTECTED]:/# /nynom/apache/php/bin/php -d
extension_dir=/nynom/apache/php/lib/php/extensions/debug-non-zts-20071006
-r '$finfo=finfo_open(FILEINFO_MIME);'
[EMAIL PROTECTED]:/# unset MAGIC
[EMAIL PROTECTED]:/# export MAGIC
[EMAIL PROTECTED]:/# /nynom/apache/php/bin/php -d
extension_dir=/nynom/apache/php/lib/php/extensions/debug-non-zts-20071006
-r '$finfo=finfo_open(FILEINFO_MIME);'
Segmentation fault (core dumped)
Fileinfo information from phpinfo():
fileinfo
fileinfo support enabled
version 1.0.5-dev
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46331&edit=1