-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Interrupt while internal frame is on the stack #14627
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
Changes from 5 commits
c5d3a9c
053090f
72369ce
c56ff0e
0b06725
cf2bcd9
ef26528
914c283
c8d9d2c
69fff37
2ffca6d
1255c71
8fa433a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -539,6 +539,18 @@ ZEND_COLD void zend_magic_get_property_type_inconsistency_error(const zend_prope | |
|
||
ZEND_COLD void zend_match_unhandled_error(const zval *value); | ||
|
||
/* Call this to handle the timeout or the interrupt function. It will not clear | ||
* the EG(vm_interrupt). | ||
*/ | ||
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_interrupt_or_timeout(zend_execute_data *call); | ||
|
||
static zend_always_inline void zend_interrupt_or_timeout_check(zend_execute_data *call) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: This function is similar to I think it would help understanding if this function was explicitly implemented as a variant of these two macros. E.g. it could be implemented as a macro named |
||
{ | ||
if (UNEXPECTED(zend_atomic_bool_exchange_ex(&EG(vm_interrupt), false))) { | ||
zend_interrupt_or_timeout(call); | ||
} | ||
} | ||
|
||
static zend_always_inline void *zend_get_bad_ptr(void) | ||
{ | ||
ZEND_UNREACHABLE(); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Do you rely on
zend_interrupt_function
to clearvm_interrupt
in this case? Should we still resetvm_interrupt
in case of timeout?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 pushed up a commit while you were reviewing ^_^
The store is done in the VM with atomic exchange which is better than a load + store individually. However in JIT, I don't have an IR instruction for atomic exchange, so there it does a load + store.