Skip to content
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

Fix uouv on oom on object allocation #11844

Closed
wants to merge 1 commit into from
Closed

Conversation

iluuu1994
Copy link
Member

@iluuu1994 iluuu1994 commented Jul 31, 2023

free_obj can run before the object is fully initialized, requiring guards for potentially unset fields.

Fixes GH-11734

@iluuu1994 iluuu1994 changed the base branch from PHP-8.1 to master August 2, 2023 11:23
@iluuu1994 iluuu1994 force-pushed the gh-11734 branch 2 times, most recently from df03193 to bde616c Compare August 2, 2023 17:08
@iluuu1994 iluuu1994 force-pushed the gh-11734 branch 2 times, most recently from 3488814 to b74b19a Compare August 3, 2023 08:14
@iluuu1994 iluuu1994 changed the base branch from master to PHP-8.1 August 3, 2023 08:14
@iluuu1994 iluuu1994 force-pushed the gh-11734 branch 4 times, most recently from f39e7e4 to 5de708e Compare August 7, 2023 19:18
@iluuu1994 iluuu1994 changed the base branch from PHP-8.1 to master August 8, 2023 09:36
We may OOM during object initialization. In this case, free_obj needs to guard
against NULL values. There may be more cases where this is an issue, these were
the ones I was able to discover via script.

Fixes phpGH-11734
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

LGTM


/* dbh might be null if we OOMed during object initialization. */
if (!dbh) {
return;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: double indent

Suggested change
return;
return;

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch 🙂

@iluuu1994
Copy link
Member Author

Merged as ee000ea.

@iluuu1994 iluuu1994 closed this Aug 14, 2023
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.

Crash in zend_objects_store_free_object_storage due to uninitialised handlers
2 participants