#19017 [Csd->Fbk]: Crash when accessing data from big associative arrays

From: Date: Fri, 30 Aug 2002 08:49:32 +0000
Subject: #19017 [Csd->Fbk]: Crash when accessing data from big associative arrays
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18233@lists.php.net to get a copy of this message
ID: 19017 Updated by: derick@php.net Reported By: xpaz@aspherio.com -Status: Closed +Status: Feedback Bug Type: Reproducible crash Operating System: Linux PHP Version: 4.2.2 New Comment: That is a *very* bad idea and only covers symtoms. Please add a backtrace to this report. Derick Previous Comments: ------------------------------------------------------------------------ [2002-08-30 04:44:12] xpaz@aspherio.com We have recompiled the apache and php to add the --enable-debug line, and it seems to have fixed the problem. I don't know what happened, but the segmentation faults have desappeared after recompiling. Thanks very much for the interest and for making PHP such a great thing :-). ------------------------------------------------------------------------ [2002-08-21 21:39:41] sniper@php.net 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 http://bugs.php.net/bugs-generating-backtrace.php 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. ------------------------------------------------------------------------ [2002-08-21 08:32:38] xpaz@aspherio.com 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 this bug report at http://bugs.php.net/?id=19017&edit=1

« previous php.bugs (#18233) next »