-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Fix high opcache.interned_strings_buffer causing shm corruption #9260
Conversation
zend_long size = zend_ini_parse_quantity_warn(new_value, entry->name); | ||
|
||
if (size < 0) { | ||
zend_accel_error(ACCEL_LOG_WARNING, "opcache.interned_strings_buffer must be higher than or equal to 0, " ZEND_LONG_FMT " given.\n", size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zend_accel_error(ACCEL_LOG_WARNING, "opcache.interned_strings_buffer must be higher than or equal to 0, " ZEND_LONG_FMT " given.\n", size); | |
zend_accel_error(ACCEL_LOG_WARNING, "opcache.interned_strings_buffer must be greater than or equal to 0, " ZEND_LONG_FMT " given.\n", size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
zend_accel_error(ACCEL_LOG_WARNING, "opcache.interned_strings_buffer must be greater than or equal to 0, " ZEND_LONG_FMT " given.\n", size); | ||
return FAILURE; | ||
} | ||
if (size > MAX_INTERNED_STRINGS_BUFFER_SIZE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know for certain if we should return an error for both cases, as you said in the ticket, it can me a mistake. However that fix the issue alright whatsoever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I wanted to be consistent with OnUpdateMemoryConsumption, but maybe returning a FAILURE in both cases here would be better.
In my opinion, ini handler failures during startup/activate should also result in a fatal error, but that's for an other PR/RFC.
It looks like this test triggers memory leaks with ASAN. https://github.com/php/php-src/runs/8281104519?check_suite_focus=true @arnaud-lb Can you have a look? There's no hurry. |
I marked the tests as |
Fixes #9259