-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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 leak in regex #17122
Comments
How exactly did you run this? And what build configuration did you use? I can't reproduce this locally. |
USE_ZEND_ALLOC=1 ./php test.php |
I tried with a couple of different build configurations, and with both |
This is the complete reproducer. |
Also, to be clear, USE_ZEND_ALLOC=0 memory leaks are irrelevant as they are typically false flags. Or am I wrong? |
For some reason this only triggers on release builds 🤔 I'll have a look tomorrow...
More or less, it's more nuanced. |
Because the subpattern names are persistent, and the fact that the symbol table destruction is skipped when using fast_shutdown, this means the refcounts will not be updated for the destruction of the arrays that hold the subpattern name keys. To solve this, detect this situation and duplicate the strings.
Because the subpattern names are persistent, and the fact that the symbol table destruction is skipped when using fast_shutdown, this means the refcounts will not be updated for the destruction of the arrays that hold the subpattern name keys. To solve this, detect this situation and duplicate the strings.
Description
The following code:
Resulted in this output:
But I expected this output instead:
PHP Version
8.4.1
Operating System
No response
The text was updated successfully, but these errors were encountered: