8000 Fix collection of unfinished function call in fibers by arnaud-lb · Pull Request #10557 · php/php-src · GitHub
[go: up one dir, main page]

Skip to content

Fix collection of unfinished function call in fibers #10557

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

Closed
wants to merge 1 commit into from

Conversation

arnaud-lb
Copy link
Member

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Comment on lines +4462 to +4479
ZEND_API ZEND_ATTRIBUTE_DEPRECATED HashTable *zend_unfinished_execution_gc(zend_execute_data *execute_data, zend_execute_data *call, zend_get_gc_buffer *gc_buffer)
{
bool suspended_by_yield = false;

if (Z_TYPE_INFO(EX(This)) & ZEND_CALL_GENERATOR) {
ZEND_ASSERT(EX(return_value));

/* The generator object is stored in EX(return_value) */
zend_generator *generator = (zend_generator*) EX(return_value);
ZEND_ASSERT(execute_data == generator->execute_data);

suspended_by_yield = !(generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING);
}

return zend_unfinished_execution_gc_ex(execute_data, call, gc_buffer, suspended_by_yield);
}

ZEND_API HashTable *zend_unfinished_execution_gc_ex(zend_execute_data *execute_data, zend_execute_data *call, zend_get_gc_buffer *gc_buffer, bool suspended_by_yield)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This avoids breaking ABI, although zend_unfinished_execution_gc was only introduced in the last patch release.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we increase the ABI number? As I don't know how ABI breaks are meant to be handled for stuff released after GA. @cmb69 or @derickr do you know what the policy is?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ABI number is the last time ABI was broken (which defacto is every minor version). Here ABI is not broken, but the original function preserved and a new one added. Hence it's a non-issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I don't know how ABI breaks are meant to be handled for stuff released after GA.

Not at all; keeping ABI compat after first GA of a minor is a pretty strict policy (otherwise all extensions etc. would need to be rebuilt).

But yeah, not an issue here.

@arnaud-lb arnaud-lb changed the base branch from master to PHP-8.1 February 10, 2023 17:17
@arnaud-lb arnaud-lb changed the title Fix colletion of unfinished function call in fibers Fix collection of unfinished function call in fibers Feb 10, 2023
@bwoebi
Copy link
Member
bwoebi commented Feb 10, 2023

Looks proper to me :-) Thanks!

8000

@arnaud-lb arnaud-lb marked this pull request as ready for review February 11, 2023 12:04
Copy link
Member
@bwoebi bwoebi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge that, it seems the most proper fix for this.

@bwoebi
Copy link
Member
bwoebi commented Feb 13, 2023

Merged as d721dcc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8.2.2: segfault when garbage collector is invoked inside of fiber
4 participants
0