From:             geoffers+phpbugs at gmail dot com
Operating system: Debian Etch
PHP version:      5.2CVS-2009-02-08 (CVS)
PHP Bug Type:     Reproducible crash
Bug description:  Calling gc_collect_cycles() with zend.enable_gc=0 causes 
segfault

Description:
------------
When running PHP with zend.enable_gc=0, a segfault occurs when trying to 
call gc_collect_cycles().

This is on Debian Etch, with everything apart from PHP 5.3 from the 
Debian stable repositories. PHP 5.3 was compiled with:

'./configure' '--enable-bcmath' '--enable-calendar' '--with-zlib-
dir=/usr' '--with-gd' '--with-apxs2=/usr/bin/apxs2' '--with-curl=/usr' 
'--without-pear' '--enable-mbstring' '--enable-debug'

I have only tested through the CLI using -d zend.enable_gc=0.

Reproduce code:
---------------
<?php
gc_collect_cycles();
?>

Expected result:
----------------
I would expect that PHP didn't crash!

Beyond that, I'd expect the result to be the same as the following when 
zend.enable_gc=1:

<?php
gc_disable();
gc_collect_cycles();
?>

which is to say that it silently fails (and returns 0).

Actual result:
--------------
Segfault:

#0  0x08449a83 in gc_mark_roots () at /root/php5/Zend/zend_gc.c:363
#1  0x0844a05e in gc_collect_cycles () at 
/root/php5/Zend/zend_gc.c:539
#2  0x08439ab6 in zif_gc_collect_cycles (ht=0, 
return_value=0xb79301ac, return_value_ptr=0x0, this_ptr=0x0, 
return_value_used=0)
    at /root/php5/Zend/zend_builtin_functions.c:336
#3  0x084536a5 in zend_do_fcall_common_helper_SPEC 
(execute_data=0xb77b8048) at /root/php5/Zend/zend_vm_execute.h:313
#4  0x084581ea in ZEND_DO_FCALL_SPEC_CONST_HANDLER 
(execute_data=0xb77b8048) at /root/php5/Zend/zend_vm_execute.h:1564
#5  0x08452ae2 in execute (op_array=0xb79307d8) at 
/root/php5/Zend/zend_vm_execute.h:104
#6  0x084286de in zend_execute_scripts (type=8, retval=0x0, 
file_count=3) at /root/php5/Zend/zend.c:1181
#7  0x083bce0c in php_execute_script (primary_file=0xbfb8bce4) at 
/root/php5/main/main.c:2147
#8  0x084b8e4b in main (argc=4, argv=0xbfb8be34) at 
/root/php5/sapi/cli/php_cli.c:1159


-- 
Edit bug report at http://bugs.php.net/?id=47341&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47341&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47341&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47341&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47341&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47341&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47341&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47341&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47341&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47341&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47341&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47341&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47341&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47341&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47341&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47341&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47341&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47341&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47341&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47341&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47341&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47341&r=mysqlcfg

Reply via email to