Skip to content

Allow using fast destruction path when ASAN is in use #18835

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danog
Copy link
Contributor

@danog danog commented Jun 11, 2025

Disabling the fast path when a custom allocator is in use hid the #18833 issue, and made it super hard to debug, this re-enables it if php is compiled with asan.

@danog
Copy link
Contributor Author

danog commented Jun 11, 2025

Ping @nielsdos

@nielsdos
Copy link
Member

By design, fast shutdown does not explicitly free all request data but defers that to ZendMM. If ZendMM is not used, but you use fast shutdown, then you get real leaks.
Therefore, your patch will report leaks with ASAN in non-debug builds.

@nielsdos
Copy link
Member

A compromise could be to make it opt-in when __SANITIZE_ADDRESS__ is set. For example, you could have an environment variable similar to USE_ZEND_ALLOC, e.g. ZEND_FORCE_FAST_SHUTDOWN. Then you check if that environment variable is set along with !EG(full_tables_cleanup) probably.

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

Successfully merging this pull request may close these issues.

2 participants