php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13289 array_map segfault
Submitted: 2001-09-13 13:50 UTC Modified: 2002-08-22 11:41 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: vincent at igeek dot co dot uk Assigned: andrei (profile)
Status: Closed Package: Arrays related
PHP Version: 4.0.6 OS: Linux version 2.2.15pre3 (benh@s
Private report: No CVE-ID: None
 [2001-09-13 13:50 UTC] vincent at igeek dot co dot uk
This is a duplicate bug. I couldn't find any way to comment 
on the last on (id 11933). I am also experiencing this 
problem, but to answer one of the questions on the previous 
bug, I am not running the Zend Optimiser, (won't run on PPC 
arch). I am afraid i was not in a position to run gdb.
Configure line:
?'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--
enable-bcmath' '--with-zlib' '--with-gd=shared' '--with-
mysql=/usr/local/mysql' '--with-jpeg-dir=/usr/local/lib' '-
-with-freetype-dir=/usr/include' '--with-png-dir=/usr/
local/lib'
Also the array_map function is called three times with the 
same function but different arrays.
This is my custom function:
function jumpURL($fileName) {
	return('<a href="?action=jump&jump=
'.base64_encode($fileName).'" target="_top">'.$fileName.'</
a>');
}
And this is the offending call:
$out = array_map('jumpURL',$out);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-29 01:13 UTC] mikemc-phpbugreport at contactdesigns dot com
I have experienced this problem as well, but in a different way and on a different platform.  I am running Linux 2.4.9 and PHP 4.1.1 and here is my configure line:

./configure --with-mysql=/usr/local/mysql --with-zlib
--with-apache=../$apache --enable-track-vars
--with-config-file=$target/conf

It is noted in the array_map() documentation on the php.net site that: "An interesting use of this function is to construct an array of arrays, which can be easily performed by using NULL as the name of the callback function."  This is where my situation differs from the original bug 13289 - I am not passing a user defined callback.

When I attempt use of array_map() in this manner:

$data = array_map(NULL, $entity, $type, $names, $values);

Where $entity, $type, $names, $values are all numerically indexed arrays of equal length, I get a segmentation fault.

This should be of particular interest since bug 13289 was running on 4.0.6 and this is occurring with 4.1.1.

I hope this helps you in some way - I wish I programmed C so I could help out.

Mike
 [2002-08-22 11:41 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 16:01:35 2024 UTC