Commit 359ad80
committed
Fix race condition in zend_runtime_jit(), zend_jit_hot_func()
zend_runtime_jit() prevents concurrent compilation with
zend_shared_alloc_lock(), but this doesn't prevent blocked threads from
trying to compile the function again after they acquire the lock.
In the case of GH-19889, one of the function entries is compiled with
zend_jit_handler(), which fails when the op handler has already been replaced by
a JIT'ed handler.
Fix by marking compiled functions with a new flag ZEND_FUNC_JITED, and
skipping compilation of marked functions. The same fix is applied to
zend_jit_hot_func().
Fixes GH-19889
Closes GH-199711 parent 08924cd commit 359ad80
File tree
3 files changed
+11
-5
lines changed- Zend/Optimizer
- ext/opcache/jit
3 files changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2945 | 2945 | | |
2946 | 2946 | | |
2947 | 2947 | | |
| 2948 | + | |
2948 | 2949 | | |
2949 | | - | |
| 2950 | + | |
2950 | 2951 | | |
2951 | 2952 | | |
2952 | 2953 | | |
| |||
2958 | 2959 | | |
2959 | 2960 | | |
2960 | 2961 | | |
2961 | | - | |
2962 | | - | |
| 2962 | + | |
2963 | 2963 | | |
2964 | 2964 | | |
2965 | 2965 | | |
| 2966 | + | |
| 2967 | + | |
2966 | 2968 | | |
2967 | 2969 | | |
2968 | 2970 | | |
| |||
3024 | 3026 | | |
3025 | 3027 | | |
3026 | 3028 | | |
3027 | | - | |
| 3029 | + | |
3028 | 3030 | | |
3029 | 3031 | | |
3030 | 3032 | | |
| |||
3039 | 3041 | | |
3040 | 3042 | | |
3041 | 3043 | | |
| 3044 | + | |
| 3045 | + | |
3042 | 3046 | | |
3043 | 3047 | | |
3044 | 3048 | | |
| |||
0 commit comments