why to call php_output_activate(TSRMLS_C) from php_module_startup
| From: | Kamesh Jayachandran | Date: | Fri, 08 Oct 2004 06:10:24 +0000 |
| Subject: | why to call php_output_activate(TSRMLS_C) from php_module_startup | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-13225@lists.php.net to get a copy of this message | ||
Hi All,
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?
With regards
Kamesh Jayachandran