|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-10-08 06:19 UTC] pajoye@php.net
[2011-10-08 06:19 UTC] pajoye@php.net
-Status: Open
+Status: Feedback
[2011-10-08 08:33 UTC] savetheinternet at omegasdg dot com
-Status: Feedback
+Status: Open
[2011-10-08 08:33 UTC] savetheinternet at omegasdg dot com
[2011-10-10 18:16 UTC] goingbackayear at hotmail dot com
[2012-04-20 10:19 UTC] vnsavage at gmail dot com
[2013-03-02 19:00 UTC] reeze@php.net
[2013-03-02 19:00 UTC] reeze@php.net
-Status: Open
+Status: Feedback
[2013-08-19 09:05 UTC] admin at dvaslona dot ru
[2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 02:00:01 2025 UTC |
Description: ------------ Although I do have a short code sample, I'm not sure where exactly or what conditions causes the segfault; I am unable to reproduce it myself. The backtrace indicates that this is indeed where the bug occurs. The code sample below is an extract from a file that is included various times throughout a much larger application. fhash is not defined anywhere else. Test script: --------------- if(!function_exists('fhash')) { function fhash($file) { system('optipng ' . escapeshellarg(preg_replace('/src\/(\d+)\.(.+)$/', 'thumb/$1.png', $file)) . ' > /dev/null'); return sha1_file($file); } } Expected result: ---------------- To ensure that fhash() is not declared multiple times as this file may be included multiple times. Actual result: -------------- (gdb) bt #0 0xb6f2ed5c in memcpy () from /lib/i686/cmov/libc.so.6 #0 0xb6f2ed5c in memcpy () from /lib/i686/cmov/libc.so.6 #1 0x084e9e17 in _zend_hash_add_or_update (ht=0x9bb7498, arKey=0xb49e3c98 "fhash", nKeyLength=6, pData=0x0, nDataSize=144, pDest=0x0, flag=2, __zend_filename=0x88aa40c "/home/<user>/php-5.3.8/Zend/zend_compile.c", __zend_lineno=2956) at /home/<user>/php-5.3.8/Zend/zend_hash.c:256 #2 0x084c3d48 in do_bind_function (opline=0xb49e88fc, function_table=0x9bb7498, compile_time=0 '\0') at /home/<user>/php-5.3.8/Zend/zend_compile.c:2956 #3 0x0850aa49 in ZEND_DECLARE_FUNCTION_SPEC_HANDLER (execute_data=0x9d79da8) at /home/<user>/php-5.3.8/Zend/zend_vm_execute.h:586 #4 0x08508506 in execute (op_array=0x9d5ceac) at /home/<user>/php- 5.3.8/Zend/zend_vm_execute.h:107 #5 0x084dcf8d in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/<user>/php-5.3.8/Zend/zend.c:1236 #6 0x08472037 in php_execute_script (primary_file=0xbfc62428) at /home/<user>/php-5.3.8/main/main.c:2284 #7 0x085a504e in main (argc=3, argv=0xbfc62594) at /home/<user>/php- 5.3.8/sapi/cgi/cgi_main.c:2112 (gdb) print (char *)executor_globals.active_op_array->filename $2 = 0xb49e34d0 "/var/www/inc/instance-config.php" (gdb) frame 4 #4 0x08508506 in execute (op_array=0x9d5ceac) at /home/<user>/php- 5.3.8/Zend/zend_vm_execute.h:107 107 if ((ret = EX(opline)->handler(execute_data TSRMLS_CC)) > 0) { (gdb) frame 2 #2 0x084c3d48 in do_bind_function (opline=0xb49e88fc, function_table=0x9bb7498, compile_time=0 '\0') at /home/<user>/php-5.3.8/Zend/zend_compile.c:2956 2956 if (zend_hash_add(function_table, opline- >op2.u.constant.value.str.val, opline- >op2.u.constant.value.str.len+1, function, sizeof(zend_function), NULL)==FAILURE) { (gdb) print (char*)opline->op2.u.constant.value.str.val $1 = 0xb49e3c98 "fhash" (gdb) frame 1 #1 0x084e9e17 in _zend_hash_add_or_update (ht=0x9bb7498, arKey=0xb49e3c98 "fhash", nKeyLength=6, pData=0x0, nDataSize=144, pDest=0x0, flag=2, __zend_filename=0x88aa40c "/home/<user>/php- 5.3.8/Zend/zend_compile.c", __zend_lineno=2956) at /home/<user>/php-5.3.8/Zend/zend_hash.c:256 256 INIT_DATA(ht, p, pData, nDataSize);