#30397 [Opn]: Segmentation fault in php_printf
| From: | kameshj at fastmail dot fm | Date: | Mon, 18 Oct 2004 05:39:17 +0000 |
| Subject: | #30397 [Opn]: Segmentation fault in php_printf | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-67709@lists.php.net to get a copy of this message | ||
ID: 30397
User updated by: kameshj at fastmail dot fm
Reported By: kameshj at fastmail dot fm
Status: Open
Bug Type: Zend Engine 2 problem
Operating System: Any Operating System
PHP Version: Irrelevant
New Comment:
I have drilled this down and found this to be a root cause and did this
change and found to be working for the past one week so in my local
setup so went ahead and checked in this change.
Why should I revert?
How long I can wait for someone to respond to my question?
If you have any problem with this patch technically please let me know
I will revert it.
Previous Comments:
------------------------------------------------------------------------
[2004-10-17 17:03:41] derick@php.net
As far as I know nobody replied to your question about this change, so
please revert it.
------------------------------------------------------------------------
[2004-10-16 12:40:32] tony2001@php.net
kameshj at fastmail dot fm:
If the bug has been fixed, than the bug report should be closed
probably?
------------------------------------------------------------------------
[2004-10-16 12:37:25] kameshj at fastmail dot fm
Commited both in 5_0 branch and 5_1 HEAD
------------------------------------------------------------------------
[2004-10-16 12:35:50] kameshj at fastmail dot fm
Fixed from hyanantha's account.
------------------------------------------------------------------------
[2004-10-11 16:49:29] kameshj at fastmail dot fm
Description:
------------
Startup errors causes the segmentation fault if display_startup_errors
is enabled.
Reproduce code:
---------------
display_startup_errors=On
extension=kamesh.so(Any nonexistent module)
start apache
Segmentation fault will happen inside php_printf.
Expected result:
----------------
It should log in a error log that non existent module. But should not
seg fault.
Actual result:
--------------
I could see php_output_activate(TSRMLS_C) getting called from
php_module_startup immedeately after php_output_startup.
Why is this needed? As each SAPI modules call
php_output_activate(TSRMLS_C) explicitly as a part of request startup.
Why am I concerned about this?
Ans: php_output_activate(TSRMLS_C) sets
OG(php_body_write) = php_ub_body_write;
which causes calls to php_printf to use php_ub_body_write which
depends
on SG(request_info) which is null while php_printf is invoked as part
of
apache startup error(Like Invalid extension/ Non existent extension)
logging.
This causes segmentation fault.
This change seems to have been introduced in version 1.371 of
main/main.c by Zeev(3 years and 3 months ago).
The comment says,
Fix a major thread safety bug in the output mechanism
@- Fixed a major memory corruption bug in the thread safe version
(Zeev)
Can I remove a call to php_output_activate(TSRMLS_C) from
php_module_startup?
PS:What is the use of display_startup_errors? What does display mean
with respect to startup as it might not have any associated request
context?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30397&edit=1