-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix ZTS crashes with persistent resources in modules #13381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -826,13 +826,19 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{ | |
} | ||
/* }}} */ | ||
|
||
static void executor_globals_dtor(zend_executor_globals *executor_globals) /* {{{ */ | ||
static void executor_globals_persistent_list_dtor(void *storage) | ||
{ | ||
zend_ini_dtor(executor_globals->ini_directives); | ||
zend_executor_globals *executor_globals = storage; | ||
|
||
if (&executor_globals->persistent_list != global_persistent_list) { | ||
zend_destroy_rsrc_list(&executor_globals->persistent_list); | ||
} | ||
} | ||
|
||
static void executor_globals_dtor(zend_executor_globals *executor_globals) /* {{{ */ | ||
{ | ||
zend_ini_dtor(executor_globals->ini_directives); | ||
|
||
if (executor_globals->zend_constants != GLOBAL_CONSTANTS_TABLE) { | ||
zend_hash_destroy(executor_globals->zend_constants); | ||
free(executor_globals->zend_constants); | ||
|
@@ -1122,6 +1128,9 @@ void zend_shutdown(void) /* {{{ */ | |
zend_vm_dtor(); | ||
|
||
zend_destroy_rsrc_list(&EG(persistent_list)); | ||
#ifdef ZTS | ||
ts_callback_id(executor_globals_id, executor_globals_persistent_list_dtor); | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This probably may be changed into (I'm not completely sure) #ifndef ZTS
zend_destroy_rsrc_list(&EG(persistent_list));
#else
ts_callback_id(executor_globals_id, executor_globals_persistent_list_dtor);
#endif There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just quickly tested this by printing out all the lists that get destroyed, and I see that it now misses the |
||
zend_destroy_modules(); | ||
|
||
virtual_cwd_deactivate(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would propose to think about a better name. e.g.
ts_apply_for_id()