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
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: 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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 19:01:35 2025 UTC