Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory corruption when using JIT #16856

Open
danog opened this issue Nov 19, 2024 · 3 comments
Open

Memory corruption when using JIT #16856

danog opened this issue Nov 19, 2024 · 3 comments

Comments

@danog
Copy link
Contributor

danog commented Nov 19, 2024

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
Copy link
Contributor Author

danog commented Nov 19, 2024

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)?

@nielsdos
Copy link
Member

Are you even sure that it's memory corruption in the first place?
I would recommend using Valgrind if you can't reproduce it using ASAN.

@danog
Copy link
Contributor Author

danog commented Nov 19, 2024

Positive, since the issue occurs only with JIT, and it can't be a race condition since it's all single-threaded anyway.

Will give valgrind a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants