Skip to content

Fix zend_observer_fcall_end_all() accessing dangling pointers #7885

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

beberlei
Copy link
Contributor

@beberlei beberlei commented Jan 5, 2022

By switching attribute constructor stackframe to be called via trampoline the stack allocation is not causing dangling pointers in the zend_observer API anymore that lead to crashes.

Follow up to #7665 and 76e2a83

@beberlei beberlei force-pushed the bug81430-missing-trampoline branch 3 times, most recently from 2f01f60 to 08f6e16 Compare January 7, 2022 11:24
@beberlei
Copy link
Contributor Author

beberlei commented Jan 7, 2022

@dstogov PR is done, Mac failure is unrelated I believe. It works very nicely, thank you for the suggestion!

@cmb69 Do you think this can be merged for next 8.0 / 8.1 releases? Would be 💯

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

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

The macOS failure is indeed unrelated (has been fixed in the meantime, so consider to rebase).

I'm generally fine with merging into PHP-8.0.

By switching attribute constructor stackframe to be called via
trampoline the stack allocation is not causing dangling pointers
in the zend_observer API anymore.

Co-Authored-By: Florian Sowade <f.sowade@suora.com>
Co-Authored-By: Christopher Becker <cmbecker69@gmx.de>
Co-Authored-By: Dmitry Stogov <dmitry@zend.com>
@beberlei beberlei force-pushed the bug81430-missing-trampoline branch from 08f6e16 to 4a9e05f Compare January 7, 2022 16:58
@dstogov
Copy link
Member

dstogov commented Jan 10, 2022

Looks good.

@cmb69 cmb69 closed this in 2f6a06c Jan 10, 2022
@javer
Copy link

javer commented Jan 11, 2022

@beberlei Thank you!

@cmb69 @dstogov Can this fix be included in the upcoming PHP 8.1.2 as well? It is very important, because without this fix it is impossible to use Tideways on PHP 8.1 with any Symfony application which uses attributes, app just crashes during cache warmup. Thanks in advance.

@cmb69
Copy link
Member

cmb69 commented Jan 11, 2022

@javer, we do not push bug fixes to release branches after the RC had been tagged (what happened a week ago). When the bug fix addresses a serious issue, there might be an exemption from this rule, but in this case it looks like there are still unresolved issues, so it's unlikely that this will be in PHP 8.1.2. But there will be PHP 8.1.3 only four weeks later.

But finally this decision is up to the release managers to make: @krakjoe, @patrickallaert, @ramsey.

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

Successfully merging this pull request may close these issues.

4 participants