From:             kameshj at fastmail dot fm
Operating system: Any Operating System
PHP version:      5.0.3
PHP Bug Type:     Apache2 related
Bug description:  apache2 restart causing divide by zero when php is introduce 
newly

Description:
------------
I found apache2 crashes with Divide by Zero error in the following
scenario. 
This is with the PHP built with ZTS mode. Hope some other defect will
occur for Non-ZTS.


With regards
Kamesh Jayachandran

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reproduce code:
---------------
1)Disable php module and start apache2.
2)enable php in the httpd.conf
3)httpd restart(Not stop and start)
4)make a request to any php page apache crashes with divide by zero.

I drilled down on this issue.
My investigation is,
Apache on startup calls php_apache_server_startup twice 
one to set a user data for a userdata_key "apache2filter_post_config"
and another to call tsrm_startup and all.
While restart it simply calls this function once which misses out call
to tsrm_startup and hence tsrm_tls_table_size is just zero inside TSRM
which causes divide by zero error in THREAD_HASH_OF macro.

This can be attributed to the loading/unloading/reloading of apache
modules to do some syntax check on its configuration(Correct me if I am
wrong This info I got from Rasmus in one of the mail thread.)

While startup post_config hook is called twice, But once when restart is
called.

Expected result:
----------------
Apache2 should not crash

Actual result:
--------------
Apache2 crashes with Divide by Zero error.

-- 
Edit bug report at http://bugs.php.net/?id=31128&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31128&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31128&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31128&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31128&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31128&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31128&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31128&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31128&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31128&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31128&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31128&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31128&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31128&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31128&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31128&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31128&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31128&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31128&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31128&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31128&r=mysqlcfg

Reply via email to