it's always segmentation's fault
| From: | Teodor Cimpoesu | Date: | Mon, 14 Feb 2000 18:08:40 +0000 |
| Subject: | it's always segmentation's fault | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-10259@lists.php.net to get a copy of this message | ||
[segme.php]
<?
function PT()
{
$numargs = func_num_args();
$filename = func_get_arg(0);
$variables = func_get_arg(1);
$values = $numargs > 1 ? func_get_arg(2) : $GLOBALS;
if (sizeof($values) < sizeof ($variable))
return -1;
$patterns = array ();
$replaces = array ();
foreach ( $variables as $key ) {
$patterns[] = "|{" . $key ."}|";
$replaces[] = $values["$key"];
}
}
PT("test.tpl", array ("bgcolor","text","info") );
[root@teo play]# php segme.php
Segmentation fault (core dumped)
[root@teo play]# gdb
which php core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
[readings...]
#0 zend_if_func_get_arg (ht=1, return_value=0x810ff3c, this_ptr=0x0,
return_value_used=1)
at zend_builtin_functions.c:144
144 *return_value = *arg;
(gdb) where
#0 zend_if_func_get_arg (ht=1, return_value=0x810ff3c, this_ptr=0x0,
return_value_used=1)
at zend_builtin_functions.c:144
#1 0x80b18a9 in execute (op_array=0x81150f0) at ./zend_execute.c:1568
#2 0x80b1a72 in execute (op_array=0x810ead4) at ./zend_execute.c:1607
#3 0x8071e8e in php_execute_script (primary_file=0xbffff984) at
main.c:1131
#4 0x8058021 in main (argc=2, argv=0xbffff9e4) at cgi_main.c:587
php binary rebuilded a minute ago from snaps.php.net
(so I won't be prompted w/ update your snap :-) also reproduced on an
older cvs snapshot.
--
CIMPOESU Teodor, Web Programmer
@ DIGICOM S.A. Bucharest, Romania
@ Internet, site development
@ teo@digiro.net , +(401)-330.47.28
official home page ~ http://www.digiro.net/
Internet web page ~ http://internet.digiro.net/