|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-12-05 21:47 UTC] steve-php-dev at spamwiz dot com
Description:
------------
If more than two arrays are passed to array_merge(), I get a segfault. This happens on one server, but not another. Here is the configure command for the one that has the problem, followed by the configure for the one that does not have the problem:
BAD SERVER
'./configure' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-zlib' '--enable-soap' '--enable-mbstring' '--with-openssl' '--with-config-file-path=/etc/php' '--with-config-file-scan-dir=/etc/php/apache.d' '--with-apache=../apache_1.3.37' '--enable-track-vars' '--without-pear' '--disable-cli' '--with-imap' '--with-imap-ssl' '--with-ldap' '--with-kerberos' '--with-gmp' '--without-spl' '--without-sqlite' '--without-pdo' '--enable-gd-native-ttf' '--with-gd' '--with-png-dir' '--with-freetype-dir' '--with-mssql'
GOOD SERVER
'./configure' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--enable-soap' '--with-zlib' '--enable-mbstring' '--with-openssl' '--with-config-file-path=/etc/php' '--with-config-file-scan-dir=/etc/php/apache.d' '--with-apache=../apache_1.3.37' '--enable-track-vars' '--without-pear' '--disable-cli' '--with-gmp' '--without-spl' '--without-sqlite' '--without-pdo'
Reproduce code:
---------------
<?
$arr1 = array(1, 2, 3);
$arr2 = array(4, 5, 6);
$arr3 = array(7, 8, 9);
$arr = array_merge($arr1, $arr2, $arr3);
header("Content-Type: text/plain");
print_r($arr);
?>
Expected result:
----------------
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
[6] => 7
[7] => 8
[8] => 9
)
Actual result:
--------------
segfault
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 11:00:01 2025 UTC |
The following produces a segfault: <? function function_call($arg1, $arg2, $arg3) {} $arr1 = array(1, 2, 3); $arr2 = array(4, 5, 6); $arr3 = array(7, 8, 9); $arr = function_call($arr1, $arr2, $arr3); echo "done"; ?> If you echo something and exit inside the function, it does not segfault.