|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-17 04:49 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 07:00:01 2025 UTC |
Description: ------------ Hi there, executing the following sequence of function calls results in a segfault in the last php_module_startup(...) call: tsrm_startup(1, 1, 0, NULL); sapi_startup(&mf_sapi_module); php_module_startup(&mf_sapi_module, NULL, 0) php_module_shutdown( TSRMLS_C ); sapi_shutdown(); tsrm_shutdown(); tsrm_startup(1, 1, 0, NULL); sapi_startup(&mf_sapi_module); php_module_startup(&mf_sapi_module, NULL, 0) I debugged and saw that php_shutdown_config() does not reset global pointers back to NULL after free()'ing them. This results in another free()-attempt during next startup. Here is a modified php_shutdown_config() which solves the problem: int php_shutdown_config(void) { zend_hash_destroy(&configuration_hash); if (php_ini_opened_path) { free(php_ini_opened_path); php_ini_opened_path = NULL; /* BUGFIX */ } if (php_ini_scanned_files) { free(php_ini_scanned_files); php_ini_scanned_files = NULL; /* BUGFIX */ } return SUCCESS; } Sorry that I don't submit a patch myself - no time, currently.... Regards, Norbert