ID:               39350
 User updated by:  phpbugs at thequod dot de
 Reported By:      phpbugs at thequod dot de
 Status:           Open
 Bug Type:         Reproducible crash
 Operating System: Ubuntu Linux
 PHP Version:      5CVS-2006-11-02 (CVS)
 New Comment:

The crash can be reproduced "inline", by

$b = trim($b);

after the implode().


Previous Comments:
------------------------------------------------------------------------

[2006-11-02 22:17:30] phpbugs at thequod dot de

Description:
------------
When imploding/joining an array with only "false" in it, 
PHP segfaults (on shutdown?).

I've found this in a more complex use case, where it 
segfaulted during execution, but probably because of this 
root problem.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208198976 (LWP 4071)]
0x083dd4f0 in _zval_dtor_func (zvalue=0xb7ebd8ec, 
__zend_filename=0x868524c
"/usr/local/src/PHP_5_2/Zend/zend_variables.h", 
__zend_lineno=35) 
at /usr/local/src/PHP_5_2/Zend/zend_variables.c:35
35                              
CHECK_ZVAL_STRING_REL(zvalue);
(gdb) bt
#0  0x083dd4f0 in _zval_dtor_func (zvalue=0xb7ebd8ec, 
__zend_filename=0x868524c
"/usr/local/src/PHP_5_2/Zend/zend_variables.h", 
__zend_lineno=35) 
at /usr/local/src/PHP_5_2/Zend/zend_variables.c:35
#1  0x083d02f8 in _zval_dtor (zvalue=0xb7ebd8ec, 
__zend_filename=0x86851e4
"/usr/local/src/PHP_5_2/Zend/zend_execute_API.c", 
__zend_lineno=414) 
at /usr/local/src/PHP_5_2/Zend/zend_variables.h:35
#2  0x083d04ba in _zval_ptr_dtor (zval_ptr=0xb7ebd92c, 
__zend_filename=0x8686238
"/usr/local/src/PHP_5_2/Zend/zend_variables.c", 
__zend_lineno=175) 
at /usr/local/src/PHP_5_2/Zend/zend_execute_API.c:414
#3  0x083dd92c in _zval_ptr_dtor_wrapper 
(zval_ptr=0xb7ebd92c) 
at /usr/local/src/PHP_5_2/Zend/zend_variables.c:175
#4  0x083eb689 in zend_hash_apply_deleter (ht=0x86e2bb0, 
p=0xb7ebd920) 
at /usr/local/src/PHP_5_2/Zend/zend_hash.c:606
#5  0x083eb80d in zend_hash_graceful_reverse_destroy 
(ht=0x86e2bb0) 
at /usr/local/src/PHP_5_2/Zend/zend_hash.c:641
#6  0x083cff2b in shutdown_executor () 
at /usr/local/src/PHP_5_2/Zend/zend_execute_API.c:239
#7  0x083df05a in zend_deactivate () 
at /usr/local/src/PHP_5_2/Zend/zend.c:840
#8  0x0838b2fc in php_request_shutdown (dummy=0x0) 
at /usr/local/src/PHP_5_2/main/main.c:1300
#9  0x0845807b in main (argc=3, argv=0xbf81bf24) 
at /usr/local/src/PHP_5_2/sapi/cli/php_cli.c:1259


Reproduce code:
---------------
<?php
$a = array(false);

$b = join("\n", $a);

var_dump($b);

echo 'bar';

?>


Expected result:
----------------
string(0) ""
bar

(PHP 5.1.6)

Actual result:
--------------
string(0) ""
barSegmentation fault (core dumped)

(PHP_5_2)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=39350&edit=1

Reply via email to