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
Sandbox PHP 5.6 using zend_execute_ex + zend_execute_internal #970
Conversation
05ea2ef
to
af62bd8
Compare
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.
Nice work @morrisonlevi! I left a few questions.
efc2fe1
to
fbecce1
Compare
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.
Very nice work @morrisonlevi!
This drops the legacy API entirely.
fbecce1
to
c88960d
Compare
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.
Excellent work @morrisonlevi 💯
Description
This PR changes the engine hooks for PHP 5.6 to use
zend_execute_ex
andzend_execute_internal
instead of fcall opcode handlers to instrument functions. This gives us the ability to trace calls made bycall_user_func
andcall_user_func_array
, and is vastly simpler. It doesn't support the legacy API at all. The span defaults and close at exit features are supported.This did require some other changes such as making a
ddtrace_span_fci
object that backs up various information about the call for the sake of theexit
handler. I also deleted some dead code paths on PHP 5.4 because they were giving build errors after making changes.It also fixes a bug in PHP 5.6+ where args that are references weren't passed into the closure's args array correctly as references.
Readiness checklist
Reviewer checklist