Skip to content

[3.12] gh-108487: Change assert that should've been DEOPT_IF #108509

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

Merged
merged 3 commits into from
Aug 26, 2023

Conversation

gvanrossum
Copy link
Member

@gvanrossum gvanrossum commented Aug 26, 2023

The assert(method != NULL) in CALL_NO_KW_LIST_APPEND is wrong -- this condition should lead to a deoptimization, and indeed there is a DEOPT_IF two lines later that will trigger if method == NULL.

Instead, add a different assert(self != NULL) after the DEOPT_IF().

This would crash in a devious repro scenario (first seen live in boto3 tests) when compiled with assertions enabled. In a production version there is no crash, so impact is limited.

(The crash also appears in main;see gh-108510.)

The assert(method != NULL) in CALL_NO_KW_LIST_APPEND is wrong --
this condition should lead to a deoptimization, and indeed there
is a DEOPT_IF two lines later that will trigger if method == NULL.

This would crash in a devious repro scenario (first seen live
in boto3 tests) when compiled with assertions enabled.
In a production version there is no crash, so impact is limited.

(The crash also appears in main; I will prepare a separate PR.)
@gvanrossum gvanrossum changed the title [3.12] gh-108487: Remove assert that should've been DEOPT_IF [3.12] gh-108487: Change assert that should've been DEOPT_IF Aug 26, 2023
@mgorny
Copy link
Contributor

mgorny commented Aug 26, 2023

Thanks. I can confirm that with these patches applied, boto3's test suite no longer crashes.

@Yhg1s Yhg1s merged commit bbdd889 into python:3.12 Aug 26, 2023
@gvanrossum gvanrossum deleted the fix-boto3-crash branch August 28, 2023 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 only security fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants