Skip to content

Fix regression from #8058#8181

Closed
kamil-tekiela wants to merge 1 commit intophp:PHP-8.0from
kamil-tekiela:rgression-8058
Closed

Fix regression from #8058#8181
kamil-tekiela wants to merge 1 commit intophp:PHP-8.0from
kamil-tekiela:rgression-8058

Conversation

@kamil-tekiela
Copy link
Member

@kamil-tekiela kamil-tekiela commented Mar 7, 2022

This is partially reversing my previous change from 93a8d5c.
The fix remains in place, but we must keep the memory copying.

@kamil-tekiela kamil-tekiela marked this pull request as ready for review March 7, 2022 12:43
@kamil-tekiela kamil-tekiela marked this pull request as draft March 7, 2022 12:44
@kamil-tekiela kamil-tekiela marked this pull request as ready for review March 7, 2022 13:55
@kamil-tekiela kamil-tekiela changed the base branch from master to PHP-8.0 March 7, 2022 13:55
@kamil-tekiela kamil-tekiela reopened this Mar 7, 2022
@cmb69
Copy link
Member

cmb69 commented Mar 30, 2022

Why do we need to keep the memory copying? Can any malfunction be reproduced? If so, adding a test case would probably be a good idea.

@kamil-tekiela
Copy link
Member Author

Why do we need to keep the memory copying? Can any malfunction be reproduced? If so, adding a test case would probably be a good idea.

It's needed to get rid of use-after-free errors that are plaguing CI. I am not sure if it actually causes a difference in behaviour as I haven't observed any and I didn't notice any new issues being raised about it. See https://dev.azure.com/phpazuredevops/PHP/_build/results?buildId=23771&view=ms.vss-test-web.build-test-results-tab

After 23 days I forgot the details of my debugging, but if I remember correctly, depending on how the prepare is called, we might expect mysqli to free the object or not. Thus, mysqlnd can't do it in place and has to first create successfully a new PS and then swap it and destroy the old one. I don't have the time to start a debugger now to collect details, but this should fix the use-after-free and not change anything in the behaviour. I don't think we can catch this in tests.

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.

Thanks for the explanation!

@cmb69
Copy link
Member

cmb69 commented Mar 31, 2022

@kamil-tekiela, it seems the PHP-8.1 and master builds are failing now; can you please have a look?

@kamil-tekiela
Copy link
Member Author

Thanks, I forgot to change the two lines when merging. It should be all green now.

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.

2 participants