Commit 5682c31
committed
Try to prevent dangling tracked_streams
We sometimes find corrupt tracked_streams pointers:
Crash stacktrace (abbreviated):
zend_hash_str_find ← SIGSEGV here
dd_php_stdiop_close_wrapper ← exec_integration.c:89
_php_stream_free
zend_file_handle_dtor
compile_filename
dd_execute_php_file ← autoload triggered by end hook
zai_sandbox_call / dd_uhook_end ← post-hook for Slim\App::__construct
execute_ex / php_execute_script
While the reason why this happens is not entirely clear, it's possible
that the previous RSHUTDOWN was not completely executed. This can happen
if there are bailouts during RSHUTDOWN.
Fix: wrap the rshutdown tracked_streams iteration in zend_try/zend_catch
so any bailout sets tracked_streams = NULL rather than leaving it dangling.
Also guard rinit against a non-NULL tracked_streams at request startup.1 parent 988edd2 commit 5682c31
1 file changed
Lines changed: 32 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
298 | 299 | | |
299 | 300 | | |
300 | 301 | | |
301 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
302 | 307 | | |
303 | 308 | | |
304 | 309 | | |
| |||
307 | 312 | | |
308 | 313 | | |
309 | 314 | | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
323 | 336 | | |
324 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
325 | 342 | | |
326 | 343 | | |
327 | 344 | | |
| |||
0 commit comments