ID: 7866
User Update by: [EMAIL PROTECTED]
Status: Closed
Bug Type: Reproduceable crash
Description: PHP switch() with crashes the Apache child with a SegV (11)

Tried on PHP4.0.4 on both machines that were running PHP4.0.3pl1 and that I 
experienced the problem with, the problem seems to be solved. Now the error is 
correctly reported as a parse error in the first include (e.g. with my previous 
example, the myfunctions.inc file)

I don't know if it was fixed specifically, but however, this 'bug' is squashed. All 
other versions of software compiled into the HTTPd are the same as before when I did 
experience the crash. 4.0.4 indeed makes the problem 404 (not found) :>

Thank you for checking into it,

Derek


Previous Comments:
---------------------------------------------------------------------------

[2001-01-07 03:48:27] [EMAIL PROTECTED]
I can not reproduce this with latest CVS. Please try PHP 4.0.4 and reopen
this bug report if problem still exists with it.

--Jani


---------------------------------------------------------------------------

[2000-11-27 08:41:13] [EMAIL PROTECTED]
My last comments did not accurately give an indication of how to reproduce the bug. I 
didn't realise at the time that it's the placement of the code that causes the 
problem. To reproduce the problem , put the code segment I gave (basically a parse 
error) in a function that is included from an included file.

e.g.

function myFunction($var) {
  switch ($var) {
    case 1,2:
  }
}

in a file myfunctions.inc

allfunctions.inc includes file myfunctions.inc

index.html includes allfunctions.inc

access index.html -> crash


I also noticed I did not have the Zend optimizer running or even loaded on the machine 
that I have this problem on. I can try the latest snapshot version, but here is a 
backtrace from 4.0.3pl1.

Thanks,

Derek


GDB backtrace:

GNU gdb 19991004
(gdb) run -X
Starting program: /usr/sbin/httpd -X
Program received signal SIGSEGV, Segmentation fault.
0x8112bed in _zval_ptr_dtor ()
(gdb) bt
#0  0x8112bed in _zval_ptr_dtor ()
#1  0x81408b1 in execute ()
#2  0x813dbe6 in execute ()
#3  0x813e6b0 in execute ()
#4  0x813e6b0 in execute ()
#5  0x813e6b0 in execute ()
#6  0x8119408 in zend_execute_scripts ()
#7  0x80afc71 in php_execute_script ()
#8  0x8122ee9 in apache_php_module_main ()
#9  0x80ad91b in send_php ()
#10 0x80ad948 in send_parsed_php ()
#11 0x8146c93 in ap_invoke_handler ()
#12 0x815a999 in ap_some_auth_required ()
#13 0x815a9fc in ap_process_request ()
#14 0x81521ee in ap_child_terminate ()
#15 0x815239c in ap_child_terminate ()
#16 0x81524f9 in ap_child_terminate ()
#17 0x8152b26 in ap_child_terminate ()
#18 0x81532c3 in main ()
#19 0x408d39cb in __libc_start_main (main=0x8152f6c <main>, argc=2,
    argv=0xbffff9b4, init=0x807d3f0 <_init>, fini=0x81ff048 <_fini>,
    rtld_fini=0x4000ae60 <_dl_fini>, stack_end=0xbffff9ac)
    at ../sysdeps/generic/libc-start.c:92


PS: Happy Thanksgiving everyone.. was also why I haven't looked back at this until now 
:)


---------------------------------------------------------------------------

[2000-11-19 12:02:20] [EMAIL PROTECTED]
Does not crash for me.
Could you try latest version from snaps.php.net?
Could you please also generate crash trace as described at
http://bugs.php.net/bugs-generating-backtrace.php?
Did you try it without the Optimizer?

---------------------------------------------------------------------------

[2000-11-17 11:54:02] [EMAIL PROTECTED]
The script:

switch ($variable) {
case 1,2:
}

crashes. I typed it accidentally instead of this (which works as I intended):

switch ($variable) {
case1:
case2:
}

I have Apache 1.3.14 compiled with PHP4.0.3pl1 as well as mod_ssl (openssl) and mm. 
Compiled from scratch on the same machine as it is running. I'm also using the Zend 
Optimizer 0.99 for PHP 4.0.3.

Script to make Apache, PHP and all other items:

cd /usr/src/apache
./configure
cd /usr/src/php
./configure --with-apache=../apache --with-my-sql ; make ; make install
cd /usr/src/openssl
./config ; make
cd /usr/src/mm
./configure --disable-shared ; make ; make install
cd /usr/src/mod_ssl
./configure --with-layout=Del --with-apache=../apache --with-ssl=../openssl --wi
th-mm=../mm --activate-module=src/modules/php4/libphp4.a
cd /usr/src/apache
make; make install


---------------------------------------------------------------------------


Full Bug description available at: http://bugs.php.net/?id=7866


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to