#19017 [NEW]: Crash when accessing data from big associative arrays

From: Date: Wed, 21 Aug 2002 12:32:40 +0000
Subject: #19017 [NEW]: Crash when accessing data from big associative arrays
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17436@lists.php.net to get a copy of this message
From: xpaz@aspherio.com Operating system: Linux PHP version: 4.2.2 PHP Bug Type: Reproducible crash Bug description: Crash when accessing data from big associative arrays We are experiencing a strange behavior from associative arrays. The following script breaks in the middle of the loop, when accessing an array element by its key. The row and element where it stops is fixed every time, but changes withchanges in the code (even when adding comments) or in the data. The array data with which I am having this error is too big to put here (about 16K). The array in this sample script does not break; you can get the script with the full data at http://www.aspherio.com/bugdata.txt The Apache error log has this kind of lines: [Wed Aug 21 14:04:59 2002] [notice] child pid 17728 exit signal Segmentation fault (11) caused by this script. I have not been able to get a core dump. PHP version is 4.2.2. Apache version is 1.3.24. OS is linux RedHat 6.2, I think. I have also got it under running PHP and Apache under windows. PHP configure line is './configure' '--with-apache=../apache_1.3.24' '--with-xml' '-with-oci8' '--prefix=/wwwphp4' '--with-config-path=/wwwphp4/conf' '--with-oracle' '--enable-track-vars' '--enable-curl' '--enable-xslt' '--with-xslt-sablot=/usr/local/lib'. The script is the following: ============================================================ <table> <? $res = unserialize('a:2:{i:0;a:8:{s:8:"username";s:7:"c31cdfa";s:4:"name";s:5:"75a68";s:11:"description";s:12:"294ba8b4c31e";s:5:"email";s:12:"67c8c3ce890e";s:9:"telephone";s:12:"7e8b7e4ac464";s:11:"disc_notice";s:0:"";s:10:"disc_limit";s:0:"";s:6:"active";s:1:"1";}i:1;a:8:{s:8:"username";s:5:"b2ff2";s:4:"name";s:13:"594f32ff9df11";s:11:"description";s:32:"ea43823c7c512cd7e727e947004208a3";s:5:"email";s:0:"";s:9:"telephone";s:0:"";s:11:"disc_notice";s:0:"";s:10:"disc_limit";s:0:"";s:6:"active";s:1:"1";}}'); foreach ($res as $data) { $chkact=""; $fullname=stripslashes($data[name]); if ($data[active]) { $chkact="checked"; } echo "<tr>"; echo "<td class=title>$data[username]</td>"; echo "<td class=title>$data[name]</td>"; echo "<td class=title>$data[description]</td>"; echo "<td class=title align=center>&nbsp;$data[disc_notice]&nbsp;</td>"; echo "<td class=title align=center>&nbsp;$data[disc_limit]&nbsp;</td>"; echo "<td class=title align=center><input type=checkbox name=active[] value=$data[username] $chkact></td>"; echo "</tr>"; } ?> </table> -- Edit bug report at http://bugs.php.net/?id=19017&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19017&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19017&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19017&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19017&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19017&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19017&r=support Expected behavior: http://bugs.php.net/fix.php?id=19017&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19017&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19017&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19017&r=globals

« previous php.bugs (#17436) next »