@@ -87,8 +87,10 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
87
87
zend_signal_queue_t * queue , * qtmp ;
88
88
89
89
#ifdef ZTS
90
- /* A signal could hit after TSRM shutdown, in this case globals are already freed. */
91
- if (tsrm_is_shutdown ()) {
90
+ /* A signal could hit after TSRM shutdown, in this case globals are already freed.
91
+ * Or it could be delivered to a thread that didn't execute PHP yet.
92
+ * In the latter case we act as if SIGG(active) is false. */
93
+ if (tsrm_is_shutdown () || !tsrm_get_ls_cache ()) {
92
94
/* Forward to default handler handler */
93
95
zend_signal_handler (signo , siginfo , context );
94
96
return ;
@@ -180,7 +182,7 @@ static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context)
180
182
sigset_t sigset ;
181
183
zend_signal_entry_t p_sig ;
182
184
#ifdef ZTS
183
- if (tsrm_is_shutdown ()) {
185
+ if (tsrm_is_shutdown ()|| ! tsrm_get_ls_cache () ) {
184
186
p_sig .flags = 0 ;
185
187
p_sig .handler = SIG_DFL ;
186
188
} else
0 commit comments