php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56275 PHP core dump with zend.ze1_compatibility_mode
Submitted: 2005-01-22 01:59 UTC Modified: 2005-04-05 11:14 UTC
From: cstdenis at ctgameinfo dot com Assigned:
Status: Not a bug Package: Fileinfo (PECL)
PHP Version: 5.0.3 OS: FreeBSD 5.3
Private report: No CVE-ID: None
 [2005-01-22 01:59 UTC] cstdenis at ctgameinfo dot com
Description:
------------
Use of this module causes a core dump or php (or httpd when php is running as a module) when zend.ze1_compatibility_mode = On in php.ini

Note, I'm running fileinfo as a module.

Work around is to turn it off, but this problem should be fixed or at least documented (maybe I just missed it if it is)

Reproduce code:
---------------
chihiro# cat test2.php
<?php
    $info = new finfo( FILEINFO_MIME );
    $mime = $info->file("/home/cstdenis/www/fanart/test.php");
    echo $mime;
?>
----------------
php.ini
-----------
zend.ze1_compatibility_mode = On

Expected result:
----------------
A mime type of the file. text/php or something.

Actual result:
--------------
chihiro# php test2.php
Segmentation fault (core dumped)

chihiro# gdb php php.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 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 "i386-marcel-freebsd"...
Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.2...done.
Loaded symbols for /lib/libcrypt.so.2
Reading symbols from /lib/libm.so.3...done.
Loaded symbols for /lib/libm.so.3
Reading symbols from /usr/local/lib/libxml2.so.5...done.
Loaded symbols for /usr/local/lib/libxml2.so.5
Reading symbols from /lib/libz.so.2...done.
Loaded symbols for /lib/libz.so.2
Reading symbols from /usr/local/lib/libiconv.so.3...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /lib/libc.so.5...done.
Loaded symbols for /lib/libc.so.5
Reading symbols from /usr/local/lib/php/20041030-debug/fileinfo.so...done.
Loaded symbols for /usr/local/lib/php/20041030-debug/fileinfo.so
Reading symbols from /usr/local/lib/libmagic.so.1...done.
Loaded symbols for /usr/local/lib/libmagic.so.1
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  _zend_is_inconsistent (ht=0x0, file=0x81b3dd0 "/usr/ports/lang/php5/work/php-5.0.3/Zend/zend_hash.c", line=754)
    at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_hash.c:53
53      /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_hash.c: No such file or directory.
        in /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_hash.c
(gdb) bt
#0  _zend_is_inconsistent (ht=0x0, file=0x81b3dd0 "/usr/ports/lang/php5/work/php-5.0.3/Zend/zend_hash.c", line=754)
    at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_hash.c:53
#1  0x08152184 in zend_hash_copy (target=0x82276a4, source=0x0, pCopyConstructor=0x8146310 <zval_add_ref>, tmp=0x0, size=4)
    at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_hash.c:754
#2  0x08160cd6 in zend_objects_clone_members (new_object=0x0, new_obj_val=Unhandled dwarf expression opcode 0x93
) at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_objects.c:116
#3  0x08160f8b in zend_objects_clone_obj (zobject=0x0) at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_objects.c:162
#4  0x0817e395 in zend_assign_to_variable (result=0x8209a88, op1=0x82278b0, op2=0x8209ab0, value=0x8226164, type=4, Ts=0xbfbfd390)
    at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_execute.c:595
#5  0x0817e938 in zend_assign_handler (execute_data=0xbfbfd4c0, opline=0x8209a84, op_array=0x81d0e24)
    at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_execute.c:2246
#6  0x081748f1 in execute (op_array=0x81d0e24) at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend_execute.c:1400
#7  0x08148774 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/ports/lang/php5/work/php-5.0.3/Zend/zend.c:1069
#8  0x08100336 in php_execute_script (primary_file=0xbfbfec40) at /usr/ports/lang/php5/work/php-5.0.3/main/main.c:1628
#9  0x0818c641 in main (argc=2, argv=0xbfbfeca0) at /usr/ports/lang/php5/work/php-5.0.3/sapi/cli/php_cli.c:943
(gdb)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-05 11:14 UTC] ilia at prohost dot org
If this bug still occurs with PHP 5.0.4, please report it as a PHP bug in bugs.php.net
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Sep 17 13:03:37 2021 UTC