From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030211 Description of problem: Using array_reduce on a nested list causes a segfault. The following code isolates the problem. <?php $a['ANY']['F550M']['HRC']['j6jt01dlq_flt.fits'][] = array("FILE_NUMBER"=>2256, "INGEST_DATE"=>'2003-01-16'); $a['ANY']['F550M']['HRC']['j6jt01dll_flt.fits'][] = array("FILE_NUMBER"=>2258, "INGEST_DATE"=>'2003-01-17'); $num = nodeCount($a); print $num; function checkNode($v,$var) { print "<pre>"; print_r($var); print "</pre>"; if (is_scalar($var)) { $v += 1; } elseif (is_null($var)) { } else { $v += nodeCount($var); } return $v; } function nodeCount($array) { $number = 0; if (is_array($array)) $number = array_reduce($array,"checkNode",0); return $number; } ?> Version-Release number of selected component (if applicable): httpd-2.0.40-11 php-4.2.2-8.0.5 How reproducible: Always Steps to Reproduce: 1. Execute code snippet Actual Results: apache error_log: [Fri Feb 21 12:52:52 2003] [notice] child pid 5618 exit signal Segmentation fault (11) Expected Results: This code should count the scalar nodes in the nested list. It should print the number 4. I can't file a bug with PHP because they will just ask me to update PHP to at least 4.2.3. I can't do this because this is a production system and we need to stay with RH releases. Additional info:
Could be relevant: http://bugs.php.net/bug.php?id=17588 http://bugs.php.net/bug.php?id=14749
Just for fun I filed a new upstream bug <http://bugs.php.net/bug.php?id=22463>. Anything else I can do to help?
It core dumps when I run it from the command line. % gdb /usr/bin/php core.30270 [symbols blah blah] #0 0x0814c3d5 in zif_array_reduce ()
No, this is perfect, thanks for the repro case and good bug report, that's all I need. All you can do is be patient. :)
The bug was marked as fixed by upstream and the fix was included in 4.3.2, but it doesn't look fixed for me in 4.3.2, which still segfaults on your test script.
Red Hat Linux is no longer supported by Red Hat, Inc. If you are still running Red Hat Linux, you are strongly advised to upgrade to a current Fedora Core release or Red Hat Enterprise Linux or comparable. Some information on which option may be right for you is available at http://www.redhat.com/rhel/migrate/redhatlinux/. Red Hat apologizes that these issues have not been resolved yet. We do want to make sure that no important bugs slip through the cracks. Please check if this issue is still present in a current Fedora Core release. If so, please change the product and version to match, and check the box indicating that the requested information has been provided. Note that any bug still open against Red Hat Linux on will be closed as 'CANTFIX' on September 30, 2006. Thanks again for your help.
Red Hat Linux is no longer supported by Red Hat, Inc. If you are still running Red Hat Linux, you are strongly advised to upgrade to a current Fedora Core release or Red Hat Enterprise Linux or comparable. Some information on which option may be right for you is available at http://www.redhat.com/rhel/migrate/redhatlinux/. Closing as CANTFIX.