php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54434 'use()' array reference crashes PHP - zend_hash.c
Submitted: 2011-03-31 18:31 UTC Modified: 2011-06-05 20:23 UTC
From: foss+php at yclian dot com Assigned: felipe (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3SVN-2011-03-31 (snap) OS: Linux/Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: foss+php at yclian dot com
New email:
PHP Version: OS:

 

 [2011-03-31 18:31 UTC] foss+php at yclian dot com
Description:
------------
This problem doesn't occur to 5.3.3 (my usual development environment) but the latest stable and snaps, tested on both 32-bit and 64-bit machine (Ubuntu Hardy and Lenny)

$ ~/opt/bin/php -v
PHP 5.3.6 (cli) (built: Mar 31 2011 16:04:07) (DEBUG)

$ ../opt/bin/php -v
PHP 5.3.7-dev (cli) (built: Apr  1 2011 00:15:05) (DEBUG)

The program will exit with return code 0 - which is the annoying part.


Test script:
---------------
<?php

function m(&$a){
  $b = &$a;
  call_user_func(function() use($b){});
}

function n($a){
  call_user_func(function() use($a){});
}

$a = array('a');

n($a);
m($a);

exit;


Expected result:
----------------
[Thread debugging using libthread_db enabled]
/home/yclian/Development/src/php5.3-201103311430/Zend/zend_hash.c(520) : ht=0x8924f6c is inconsistent

Program exited normally.
(gdb) quit


Actual result:
--------------
Do not fail.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-31 20:26 UTC] foss+php at yclian dot com
-: foss@yclian.com +: foss+php at yclian dot com
 [2011-03-31 20:26 UTC] foss+php at yclian dot com
Apparently I made a mistake on the 'expected result' vs. 'actual result'. Sorry about it.
 [2011-04-02 18:56 UTC] felipe@php.net
-Package: Arrays related +Package: Scripting Engine problem
 [2011-06-05 20:23 UTC] felipe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2011-06-05 20:23 UTC] felipe@php.net
This issue looks already fixed (probably by fixing #54358).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 18:02:40 2024 UTC