Skip to content

[6.0][RemoteInspection] Ignore MetadataSource records with NULL source pointer. #73220

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

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Apr 24, 2024

Cherry-pick #73200 to release/6.0.

We'd crash on a call to getKind(). Ignore them instead by returning false from isMetadataSourceReady. If this causes getClosureContextInfo to fail to make forward progress, then it will in turn fail and return nullptr to its caller.

rdar://126866747

…e pointer.

We'd crash on a call to getKind(). Ignore them instead by returning false from isMetadataSourceReady. If this causes getClosureContextInfo to fail to make forward progress, then it will in turn fail and return nullptr to its caller.

rdar://126866747
(cherry picked from commit 545441e)
@mikeash mikeash requested a review from a team as a code owner April 24, 2024 13:05
@mikeash
Copy link
Contributor Author

mikeash commented Apr 24, 2024

Explanation: Remote Mirror is missing a NULL check on the metadata source pointer in a closure capture context. In rare circumstances, we can encounter NULL here and crash.
Original PR: #73200
Reviewed by: @al45tair
Risk: Very low. This turns a crash on NULL into a more graceful failure.
Resolves: rdar://126866747
Tests: The Swift test suite thoroughly exercises this code in the non-NULL case. I haven't been able to figure out exactly what triggers a NULL value here so that doesn't have a specific test.

@mikeash
Copy link
Contributor Author

mikeash commented Apr 24, 2024

@swift-ci please test

@mikeash mikeash enabled auto-merge April 24, 2024 15:51
@mikeash
Copy link
Contributor Author

mikeash commented Apr 25, 2024

@swift-ci please test

@mikeash mikeash merged commit c3c163a into swiftlang:release/6.0 Apr 26, 2024
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