-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix #78429: opcache_compile_file(__FILE__); segfaults #4570
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
Conversation
We have to ensure that OPcache has been properly started up when `opcache_compile_file()` is called.
@@ -852,6 +852,11 @@ static ZEND_FUNCTION(opcache_compile_file) | |||
return; | |||
} | |||
|
|||
if (!accel_startup_ok) { | |||
zend_error(E_NOTICE, ACCELERATOR_PRODUCT_NAME " has not been properly started, can't compile file"); |
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.
Unrelated: Is there even a need for the ACCELERATOR_PRODUCT_NAME
to still be a thing as its development is managed by us?
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.
Frankly, I don't know, but in doubt we should stick with it.
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.
@dstogov Any input here? Is this something Zend uses internally still?
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.
could this error message contain a hint where to look for the problem cause, e.g. ini-setting opcache.enable_cli
?
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.
From what I can tell, OPcache might not be started for completely different reasons as well (e.g. because it failed to attach to the SHM on Windows).
@dstogov, is this good to merge? |
Unless there are objections, I'll merge this PR in a few hours, so the patch makes it into PHP 7.4.0RC2. |
Sorry, I missed this. It's OK to merge. |
Thanks @dstogov! |
Applied as 20f73d3. |
We have to ensure that OPcache has been properly started up when
opcache_compile_file()
is called.