PHP 4.0 Bug #5058: Segmentation fault using trange OO code
| From: | palmer at proscenio dot org | Date: | Thu, 15 Jun 2000 13:12:52 +0000 |
| Subject: | PHP 4.0 Bug #5058: Segmentation fault using trange OO code | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-21415@lists.php.net to get a copy of this message | ||
From: palmer@proscenio.org
Operating system: Linux 2.2.13
PHP version: 4.0.0 Release
PHP Bug Type: Reproduceable crash
Bug description: Segmentation fault using trange OO code
This is not a rilevant bug but...:
<?
class dummy
{
function paperino()
{
return "foo";
}
function paperino($a) // This is not wrong in PHP4 ?!
{
// But this is WRONG !! => Segmentation fault (core dumped)
$b = $this->paperino();
return $a.$b;
}
}
$a = new dummy;
echo $a->paperino("bar")."\n";
?>
This script perform a Segmentation fault
Using gdb:
palmer@persefone:$ gdb
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i586-debian-linux), Copyright 1996 Free Software Foundation, Inc.
(gdb) file /usr/serv/work-cgi/php4
Reading symbols from /usr/serv/work-cgi/php4...done.
(gdb) set args ./prova.p4
(gdb) run
Starting program: /usr/serv/work-cgi/php4 ./prova.p4
Program received signal SIGSEGV, Segmentation fault.
0x8086231 in php_error_cb (type=8,
format=0x8113bd3 "Missing argument %d for %s()\n") at main.c:311
311 {
palmer@persefone:$
The some script in PHP3 (3.0.7) generate a neverendig cicle:
<b>Warning</b>: Missing argument 1 in call to paperino() in <b>prova.p4</b>
on line <b>9</b><br>
<br>
<b>Warning</b>: Missing argument 1 in call to paperino() in <b>prova.p4</b>
on line <b>9</b><br>
<br>
<b>Warning</b>: Missing argument 1 in call to paperino() in <b>prova.p4</b>
on line <b>9</b><br>
<br>
...