-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Commit 06ae750
Fixes GH-8789.
Fixes GH-10015.
This is one small part of the underlying bug for GH-10737, as in my
attempts to reproduce the issue I constantly hit this crash easily.
(The fix for the other underlying issue for that bug will follow soon.)
It's possible that a signal arrives at a thread that never handled a PHP
request before. This causes the signal globals to dereference a NULL
pointer because the TSRM pointers for the thread aren't set up to point
to the thread resources yet.
PR GH-9766 previously fixed this for master by ignoring the signal if
the thread didn't handle a PHP request yet. While this fixes the crash
bug, I think the solution is suboptimal for 3 reasons:
1) The signal is ignored and a message is printed saying there is a bug.
However, this is not a bug at all. For example in Apache, the signal
set up happens on child process creation, and the thread resource
creation happens lazily when the first request is handled by the
thread. Hence, the fact that the thread resources aren't set up yet
is not actually buggy behaviour.
2) I believe since it was believed to be buggy behaviour, that fix was
only applied to master, so 8.1 & 8.2 keep on crashing.
3) We can do better than ignoring the signal. By just acting in the
same way as if the signals aren't active. This means we need to
take the same path as if the TSRM had already shut down.
Closes GH-10861.
1 parent 5adeed3 commit 06ae750
2 files changed
+9
-3
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 | + | ||
13 | + | ||
14 | + | ||
15 | + | ||
12 | 16 |
| |
13 | 17 |
| |
14 | 18 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
85 | 85 |
| |
86 | 86 |
| |
87 | 87 |
| |
88 | - | ||
89 | - | ||
88 | + | ||
89 | + | ||
90 | + | ||
91 | + | ||
90 | 92 |
| |
91 | 93 |
| |
92 | 94 |
| |
| |||
178 | 180 |
| |
179 | 181 |
| |
180 | 182 |
| |
181 | - | ||
183 | + | ||
182 | 184 |
| |
183 | 185 |
| |
184 | 186 |
| |
|
0 commit comments