php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41295 Crash when calling each()
Submitted: 2007-05-05 10:58 UTC Modified: 2007-05-07 12:39 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: php at fiddaman dot net Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5CVS-2007-05-05 (snap) OS: Solaris SPARC 64-bit
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at fiddaman dot net
New email:
PHP Version: OS:

 

 [2007-05-05 10:58 UTC] php at fiddaman dot net
Description:
------------
I upgraded from 5.2.1 to 5.2.2 and PHP started crashing with my application so I downloaded the latest snapshot and configured with --disable-all with the same result.

Reproduce code:
---------------
<?php

$p = array('id');
print_r(each($p));

?>

Expected result:
----------------
Array
(
    [1] => id
    [value] => id
    [0] => 0
    [key] => 0
)


Actual result:
--------------
Starting program: /data/src/build/php5.2-200705050830/sapi/cli/php /test.php

Program received signal SIGSEGV, Segmentation fault.
0x00000001001081b0 in _zval_ptr_dtor (zval_ptr=0x0)
    at /data/src/build/php5.2-200705050830/Zend/zend_execute_API.c:412
412             (*zval_ptr)->refcount--;
(gdb) where
#0  0x00000001001081b0 in _zval_ptr_dtor (zval_ptr=0x0)
    at /data/src/build/php5.2-200705050830/Zend/zend_execute_API.c:412
#1  0x0000000100147340 in zend_do_fcall_common_helper_SPEC (
    execute_data=0xffffffff7fffeed8)
    at /data/src/build/php5.2-200705050830/Zend/zend_execute.h:155
#2  0x00000001001371d0 in execute (op_array=0xffffffff7ffff0b0)
    at /data/src/build/php5.2-200705050830/Zend/zend_vm_execute.h:92
#3  0x0000000100116b18 in zend_execute_scripts (type=3576176, retval=0x0,
    file_count=3457024) at /data/src/build/php5.2-200705050830/Zend/zend.c:1134
#4  0x00000001000cdac8 in php_execute_script (primary_file=0x0)
    at /data/src/build/php5.2-200705050830/main/main.c:1794
#5  0x00000001001a53f8 in main (argc=0, argv=0x0)
    at /data/src/build/php5.2-200705050830/sapi/cli/php_cli.c:1130


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-05 11:11 UTC] derick@php.net
Works fine for me on 64bit Linux.
 [2007-05-05 11:43 UTC] tony2001@php.net
Cannnot reproduce on Linux.
Make sure you don't have any zend_extension's loaded.
What compiler did you use? (GCC 4.0.x and 4.1.1 are known to cause problems on SPARC)
 [2007-05-06 10:45 UTC] redfernpaul1 at mac dot com
(Have just voted) - and am using Apache 2.2.4 but I am running php 5.2.2. under Win XP SP2 and used installer.msi to install
 [2007-05-06 22:09 UTC] php at fiddaman dot net
I used gcc 4.1.1 but I've now recompiled with 3.4.6 and it seems fine. Looks like a compiler issue, thanks.
 [2007-05-07 12:39 UTC] tony2001@php.net
Update GCC to 4.1.2, it should work fine too.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 20:01:55 2025 UTC