php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31648 php -r Segfault when assigning values in an array in an infinite loop.
Submitted: 2005-01-21 22:16 UTC Modified: 2005-01-21 22:39 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: kermodebear at kermodebear dot org Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.3.10 OS: Redhat Linux krnl 2.4.21-20ELsmp
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: kermodebear at kermodebear dot org
New email:
PHP Version: OS:

 

 [2005-01-21 22:16 UTC] kermodebear at kermodebear dot org
Description:
------------
When using the -r option on the command line and the code below, PHP will cause a segmentation fault after script time limit is reached. This is reproducable in that it happens most of the time, but not all of the time. Once, PHP simply hung when the time limit was reached; I let it sit for about a minute after the 'time limit exceeded' message was displayed, and was able to kill it with ^C.

System is running RedHat Linux Enterprise Edition, with kernel version 2.4.21-20.ELsmp.

Configure Command =>  './configure' '--prefix=/usr' '--with-config-file-path=/etc' '--with-apxs=/usr/local/apache/bin/apxs' '--with-iconv' '--with-openssl=/usr/local/ssl' '--with-zlib-dir=/usr/lib' '--with-mysql=/usr/local/mysql' '--with-pgsql=shared' '--with-gd' '--with-pdflib=/usr/local' '--with-png-dir=/usr/local/include' '--with-jpeg-dir=/usr/lib' '--with-tiff-dir=/usr/local' '--with-curl=/usr' '--with-expat-dir=/usr' '--with-dom=/usr' '--with-ldap' '--with-xmlrpc' '--enable-sockets' '--enable-dbx' '--enable-dbase' '--enable-exif' '--enable-wddx' '--enable-ftp' '--enable-mbstring' '--with-ncurses' '--with-pspell' '--with-mssql'

Reproduce code:
---------------
php -r 'set_time_limit( 2 ); $a = 1; $b = array(); while( true ) { $b[] = $a; }'

Expected result:
----------------
Fatal error: Maximum execution time of 2 seconds exceeded in Command line code on line 1


Actual result:
--------------
Fatal error: Maximum execution time of 2 seconds exceeded in Command line code on line 1
Segmentation fault


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-21 22:39 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Arrays have a limited size... you\'re definitely exceeding this with this code.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 17:01:30 2024 UTC