php / php-src

The PHP Interpreter
https://www.php.net
Other
38.23k stars 7.75k forks source link

Memory corruption when using JIT #16856

Open danog opened 1 hour ago

danog commented 1 hour ago

Description

Running the https://github.com/amphp/pipeline unit tests on nightly with function or tracing JIT on nightly produces a memory corruption which is not detected by ASAN, which causes runtime "Event loop terminated without resuming the current suspension" exceptions.

The same memory corruption issue occasionally occurs on a production instance running code unrelated to amphp/pipeline on PHP 8.3 with opcache, without JIT (the cause there is likely different, but affecting the same memory area).

Reproducer: https://github.com/danog/jit_bugs/, bugs/14_pipeline.sh

PHP Version

nightly

Operating System

No response

danog commented 1 hour ago

Any pointers on what ASAN settings can be tweaked to make it detect the corruption (apart from the standard USE_ZEND_ALLOC=0 et al)?