You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SEGV zend_jit_op_array_hot with property hooks and preloading #18898
/home/phpfuzz/WorkSpace/flowfusion/php-src/ext/opcache/jit/zend_jit_vm_helpers.c:316:19: runtime error: member access within null pointer of type 'zend_jit_op_array_hot_extension' (aka 'struct _zend_jit_op_array_hot_extension')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/phpfuzz/WorkSpace/flowfusion/php-src/ext/opcache/jit/zend_jit_vm_helpers.c:316:19 in
@nielsdos I worry this could be a variant. this loads gh18534_preload in 1235, while #18639 loads preload_gh18567 in 1255
backtrace is different:
/home/phpfuzz/WorkSpace/flowfusion/php-src/ext/opcache/jit/zend_jit_vm_helpers.c:316:19: runtime error: member access within null pointer of type 'zend_jit_op_array_hot_extension' (aka 'struct _zend_jit_op_array_hot_extension')
#0 0x7da05c069194 in zend_jit_func_counter_helper /home/phpfuzz/WorkSpace/flowfusion/php-src/ext/opcache/jit/zend_jit_vm_helpers.c:316:19
#1 0x4b5be93 in execute_ex /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_vm_execute.h:58696:12
#2 0x4aecf78 in zend_call_function /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_execute_API.c:1007:3
#3 0x4af362e in zend_call_known_function /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_execute_API.c:1101:23
#4 0x575dcb4 in zend_call_known_instance_method /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_API.h:865:2
#5 0x571564b in zend_call_known_instance_method_with_0_params /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_API.h:871:2
#6 0x572667b in zend_call_get_hook /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_object_handlers.c:725:2
#7 0x571fe1d in zend_std_read_property /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_object_handlers.c:838:8
#8 0x52b35ca in ZEND_FETCH_OBJ_R_SPEC_CV_CONST_INLINE_HANDLER /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_vm_execute.h:43187:12
#9 0x4ee448c in ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_vm_execute.h:43216:2
#10 0x4b5be93 in execute_ex /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_vm_execute.h:58696:12
#11 0x4b5e41c in zend_execute /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_vm_execute.h:64385:2
#12 0x58d31a9 in zend_execute_script /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend.c:1943:3
#13 0x40c6b3a in php_execute_script_ex /home/phpfuzz/WorkSpace/flowfusion/php-src/main/main.c:2594:13
#14 0x40c7c78 in php_execute_script /home/phpfuzz/WorkSpace/flowfusion/php-src/main/main.c:2634:9
#15 0x58e80ba in do_cli /home/phpfuzz/WorkSpace/flowfusion/php-src/sapi/cli/php_cli.c:952:5
#16 0x58e249f in main /home/phpfuzz/WorkSpace/flowfusion/php-src/sapi/cli/php_cli.c:1363:18
#17 0x7da063501d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#18 0x7da063501e3f in __libc_start_main csu/../csu/libc-start.c:392:3
#19 0x6061a4 in _start (/home/phpfuzz/WorkSpace/flowfusion/php-src/sapi/cli/php+0x6061a4)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/phpfuzz/WorkSpace/flowfusion/php-src/ext/opcache/jit/zend_jit_vm_helpers.c:316:19 in
Thanks for getting back. I'm pretty sure all the preloading+JIT ones are related: they're all accessing the arena data from preloading in the non-preloaded execution. We have 2 other reports that are like this. But okay, I'll keep this open until all of those are resolved.
On first sight, the draft fix that I have for GH-14082 will also fix this one. I'll keep this open until my fix for GH-14082 went through review+gets merged and then I'll re-check.
Trying this on lower branches without hooks: it works, whereas without GH-14082's fix it doesn't.
On 8.4+ it crashes when calling the hook. So there are two bugs here of which one is fixed and the other not yet...
==244590==ERROR: AddressSanitizer: SEGV on unknown address 0x0000000000a0 (pc 0x000049c5037b bp 0x7ffcffcb8510 sp 0x7ffcffcb8280 T0)
==244590==The signal is caused by a READ memory access.
==244590==Hint: address points to the zero page.
#0 0x000049c5037b (/dev/zero (deleted)+0x800037b)
#1 0x55d837f05618 in zend_call_function /run/media/niels/MoreData/php-8.4/Zend/zend_execute_API.c:1000
#2 0x55d837f06631 in zend_call_known_function /run/media/niels/MoreData/php-8.4/Zend/zend_execute_API.c:1094
#3 0x55d838197a38 in zend_call_known_instance_method /run/media/niels/MoreData/php-8.4/Zend/zend_API.h:860
#4 0x55d838197a72 in zend_call_known_instance_method_with_0_params /run/media/niels/MoreData/php-8.4/Zend/zend_API.h:866
#5 0x55d83819bd40 in zend_call_get_hook /run/media/niels/MoreData/php-8.4/Zend/zend_object_handlers.c:723
#6 0x55d83819cc68 in zend_std_read_property /run/media/niels/MoreData/php-8.4/Zend/zend_object_handlers.c:837
#7 0x55d83805394a in ZEND_FETCH_OBJ_R_SPEC_CV_CONST_INLINE_HANDLER /run/media/niels/MoreData/php-8.4/Zend/zend_vm_execute.h:43150
#8 0x55d8380af7a8 in execute_ex /run/media/niels/MoreData/php-8.4/Zend/zend_vm_execute.h:63312
#9 0x55d8380b3121 in zend_execute /run/media/niels/MoreData/php-8.4/Zend/zend_vm_execute.h:64308
#10 0x55d8382166fc in zend_execute_script /run/media/niels/MoreData/php-8.4/Zend/zend.c:1934
#11 0x55d837c654d6 in php_execute_script_ex /run/media/niels/MoreData/php-8.4/main/main.c:2575
#12 0x55d837c658de in php_execute_script /run/media/niels/MoreData/php-8.4/main/main.c:2615
#13 0x55d83821bfeb in do_cli /run/media/niels/MoreData/php-8.4/sapi/cli/php_cli.c:935
#14 0x55d83821df15 in main /run/media/niels/MoreData/php-8.4/sapi/cli/php_cli.c:1310
#15 0x7f937a0376b4 (/usr/lib/libc.so.6+0x276b4) (BuildId: 468e3585c794491a48ea75fceb9e4d6b1464fc35)
#16 0x7f937a037768 in __libc_start_main (/usr/lib/libc.so.6+0x27768) (BuildId: 468e3585c794491a48ea75fceb9e4d6b1464fc35)
#17 0x55d837005814 in _start (/run/media/niels/MoreData/php-8.4/sapi/cli/php+0x605814) (BuildId: ac11206fea3160206111b5c7c1170a5a76a943ad)
changed the title [-]SEGV zend_jit_op_array_hot with property hooks[/-][+]SEGV zend_jit_op_array_hot with property hooks and preloading[/+]on Jun 23, 2025
Activity
ndossche commentedon Jun 22, 2025
Duplicate of #18639
YuanchengJiang commentedon Jun 22, 2025
@nielsdos I worry this could be a variant. this loads gh18534_preload in 1235, while #18639 loads preload_gh18567 in 1255
backtrace is different:
ndossche commentedon Jun 22, 2025
Thanks for getting back. I'm pretty sure all the preloading+JIT ones are related: they're all accessing the arena data from preloading in the non-preloaded execution. We have 2 other reports that are like this. But okay, I'll keep this open until all of those are resolved.
ndossche commentedon Jun 22, 2025
On first sight, the draft fix that I have for GH-14082 will also fix this one. I'll keep this open until my fix for GH-14082 went through review+gets merged and then I'll re-check.
ndossche commentedon Jun 23, 2025
Trying this on lower branches without hooks: it works, whereas without GH-14082's fix it doesn't.
On 8.4+ it crashes when calling the hook. So there are two bugs here of which one is fixed and the other not yet...
ndossche commentedon Jun 23, 2025
The crash location is now also different:
[-]SEGV zend_jit_op_array_hot[/-][+]SEGV zend_jit_op_array_hot with property hooks[/+][-]SEGV zend_jit_op_array_hot with property hooks[/-][+]SEGV zend_jit_op_array_hot with property hooks and preloading[/+]Fix phpGH-18898: SEGV zend_jit_op_array_hot with property hooks and p…
Fix GH-18898: SEGV zend_jit_op_array_hot with property hooks and prel…
Merge branch 'PHP-8.4'