|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15051 assigning a reference of a part of an array to itself
Submitted: 2002-01-15 11:51 UTC Modified: 2002-08-06 01:00 UTC
From: kaufmann at bluehands dot de Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 4.1.1 OS: S.u.S.E Linux 7.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
17 + 45 = ?
Subscribe to this entry?

 [2002-01-15 11:51 UTC] kaufmann at bluehands dot de
**** the script
$data[1][a] = 1;

$data = &$data[1];    // crashes here without --enable-debug

print_r($data);       // crashes here with --enable-debug

**** the system
Suse Linux 7.1
Linux camouflage 2.4.5 #8 Tue Jun 26 17:05:34 CEST 2001 i686 unknown
Server Version: Apache/1.3.22 (Unix) PHP/4.1.1 mod_backhand/1.2.1

**** PHP configuration
./configure \
  --without-mysql \
  --with-sybase-ct=/opt/sybase/ \
  --with-apxs=/opt/apache/bin/apxs \

**** apache error-log 
FATAL:  erealloc():  Unable to allocate 1515872257 bytes (only with --enable-debug)
[Sun Jan 13 19:05:30 2002] [notice] child pid 5198 exit signal Segmentation fault (11)                                      

**** backtrace
unfortunately I can't get a backtrace of the apache

**** description
for a long time we run a quite complex web application with php up to version 4.0.6 without problems. With php 4.1.1 all constructions trying to reduce the depth of a large array by assigning a reference to itself let apache crash. While debugging this problem I discovered a very short and easy script to reproduce the crash. It's somewhat strage that the short script also crashes with php 4.0.6. Anyway, removing all constructions like $array = &$array[index] from all our scripts fixed the problem for our web application.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-04 18:28 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

Please try to reproduce with a fresher version of PHP


 [2002-08-06 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 04:01:30 2024 UTC