Bug #17945 Updated: (inifinitive) recursive function call causes segmentation fault
| From: | mfischer@php.net | Date: | Mon, 24 Jun 2002 13:25:03 +0000 |
| Subject: | Bug #17945 Updated: (inifinitive) recursive function call causes segmentation fault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-11910@lists.php.net to get a copy of this message | ||
ID: 17945
Updated by: mfischer@php.net
Reported By: tilman.giese@globalview.de
-Status: Open
+Status: Won't fix
Bug Type: Reproducible crash
Operating System: SuSE Linux 7.3
PHP Version: 4.2.1
New Comment:
There are no checks to PHP is free to crash if developers are don't
watch out/code stupid (no offensive, but that's the real world).
You can use something like google.com/search?q=xdebug which has
recusrive protection.
Previous Comments:
------------------------------------------------------------------------
[2002-06-24 09:21:19] tilman.giese@globalview.de
I wrote a class with a function to add a key to an assoziative array.
Unfortunately, I got an infinite loop when changing function names.
Therefore, I got a segmentation fault in apache. The function looks
like this:
function setAttribute($name, $value) {
if (array_key_exists($name, $this->cfgAttributes) && trim($value)) {
return $this->setAttribute($this->cfgAttributes[$name],
$this->encode($value));
} else return false;
}
The reproducible segmentation fault looks like:
#0 0x400f4ae5 in chunk_free () from /lib/libc.so.6
#1 0x400f49a3 in free () from /lib/libc.so.6
#2 0x40322a9c in shutdown_memory_manager (silent=1, clean_cache=0) at
zend_alloc.c:468
#3 0x403490b5 in php_request_shutdown (dummy=0x0) at main.c:794
#4 0x40345b93 in apache_php_module_main (r=0x814b0e8,
display_source_mode=0) at sapi_apache.c:96
#5 0x403466ff in send_php (r=0x814b0e8, display_source_mode=0,
filename=0x0) at mod_php4.c:575
#6 0x40346763 in send_parsed_php (r=0x814b0e8) at mod_php4.c:590
#7 0x08056819 in ap_invoke_handler ()
#8 0x0806d1bf in process_request_internal ()
#9 0x0806d232 in ap_process_request ()
#10 0x080638a6 in child_main ()
#11 0x08063a85 in make_child ()
#12 0x08063c06 in startuo_children ()
#13 0x080642ad in standalone_main ()
#14 0x08064b3c in main ()
#15 0x4009d7ee in __libc_start_main () from /lib/libc.so.6
I solved the problem because it was only a spelling mistake, but php
should not produce a segmentation fault, does not it?
Tilman
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17945&edit=1