php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2047 Crash in zend_hash_find() with a class declaration
Submitted: 1999-08-13 11:24 UTC Modified: 1999-08-14 09:01 UTC
From: christophe dot massiot at mail dot dotcom dot fr Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0 Beta 2 OS: Linux 2.0.36/Debian slink
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: christophe dot massiot at mail dot dotcom dot fr
New email:
PHP Version: OS:

 

 [1999-08-13 11:24 UTC] christophe dot massiot at mail dot dotcom dot fr
This one is a bit weird and I can't really help you as much as I would like. I experience
a lot of crashes while testing php4. The crashes seem to occur at random (a simple 
"reload" makes the problem disappear), but I have noticed it occurs almost every
time after I modify the file I try to access (making debugging quite difficult). A simple
modification like adding echo() or exit() makes it crash. But the second time I load the
page it works fine. It might be a problem with ZendPersistentRegistry.

Note that I have not been able to reproduce the problem with PHP compiled as a CGI. Only as an apache static module.

Here is a backtrace of httpd -X :

#0  0x80aef53 in zend_hash_find ()
#1  0x80a4203 in do_return ()
#2  0x80a4fde in do_end_class_declaration ()
#3  0x80b0235 in zendparse ()
#4  0x809e99e in v_compile_files ()
#5  0x809e904 in compile_files ()
#6  0x809ea7c in compile_filename ()
#7  0x80b5478 in execute ()
#8  0x80b54f5 in execute ()
#9  0x807333c in php_execute_script ()
#10 0x80733c0 in apache_php_module_main ()
#11 0x8071934 in send_php ()
#12 0x8071980 in send_parsed_php ()
#13 0x80baf13 in ap_invoke_handler ()
#14 0x80ce5c9 in ap_some_auth_required ()
#15 0x80ce62c in ap_process_request ()
#16 0x80c61ae in ap_child_terminate ()
#17 0x80c6348 in ap_child_terminate ()
#18 0x80c64b3 in ap_child_terminate ()
#19 0x80c6ae6 in ap_child_terminate ()
#20 0x80c7253 in main ()
#21 0x400e8212 in __libc_start_main () from /lib/libc.so.6

My libc is :
ii  libc6           2.1.2-0pre2    GNU C Library: Shared libraries and timezone

Good luck, folks. I can supply the content of my classes, but they are quite large and debugging from inside PHP is difficult.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-08-13 17:02 UTC] christophe dot massiot at mail dot dotcom dot fr
I  now have a short script that reproduces the problem every time.
Create two files : 
22:52 [webase3:p0] titi:~/html% cat test.php
<?
  echo "toto";
  include("testinc.php");
  class toto3 extends toto2 { }
?>
22:52 [webase3:p0] titi:~/html% cat testinc.php
<?
class toto1 { }
class toto2 extends toto1 { }
?>

Now try to access to test.php twice. The second time httpd should segfault (at
least it segfaults on my box).

Other information that might be useful : while playing with it I experienced two
other types of crashes that may be related, with a slightly different backtrace.
Here they are :

Program received signal SIGSEGV, Segmentation fault.
0x80a0067 in lex_scan ()
(gdb) bt
#0  0x80a0067 in lex_scan ()
#1  0x80a4203 in do_return ()
#2  0x80a4fde in do_end_class_declaration ()
#3  0x80b0235 in zendparse ()
#4  0x809e99e in v_compile_files ()
#5  0x809e904 in compile_files ()
#6  0x809ea7c in compile_filename ()
#7  0x80b5478 in execute ()
#8  0x807333c in php_execute_script ()
#9  0x80733c0 in apache_php_module_main ()
#10 0x8071934 in send_php ()
#11 0x8071980 in send_parsed_php ()
#12 0x80baf13 in ap_invoke_handler ()
#13 0x80ce5c9 in ap_some_auth_required ()
#14 0x80ce62c in ap_process_request ()
#15 0x80c61ae in ap_child_terminate ()
#16 0x80c6348 in ap_child_terminate ()
#17 0x80c64b3 in ap_child_terminate ()
#18 0x80c6ae6 in ap_child_terminate ()
#19 0x80c7253 in main ()
#20 0x400e8212 in __libc_start_main () from /lib/libc.so.6

Program received signal SIGILL, Illegal instruction.
0x8165b45 in ?? ()
(gdb) bt
#0  0x8165b45 in ?? ()
#1  0x80a4203 in do_return ()
#2  0x80a4fde in do_end_class_declaration ()
#3  0x80b0235 in zendparse ()
#4  0x809e99e in v_compile_files ()
#5  0x809e904 in compile_files ()
#6  0x809ea7c in compile_filename ()
#7  0x80b5478 in execute ()
#8  0x807333c in php_execute_script ()
#9  0x80733c0 in apache_php_module_main ()
#10 0x8071934 in send_php ()
#11 0x8071980 in send_parsed_php ()
#12 0x80baf13 in ap_invoke_handler ()
#13 0x80ce5c9 in ap_some_auth_required ()
#14 0x80ce62c in ap_process_request ()
#15 0x80c61ae in ap_child_terminate ()
#16 0x80c6348 in ap_child_terminate ()
#17 0x80c64b3 in ap_child_terminate ()
#18 0x80c6ae6 in ap_child_terminate ()
#19 0x80c7253 in main ()
#20 0x400e8212 in __libc_start_main () from /lib/libc.so.6

 [1999-08-14 09:01 UTC] zeev at cvs dot php dot net
Fixed in the latest CVS - thanks!

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 05:01:30 2024 UTC