Skip to content

TestFoundation: fix a double free #2236

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 1 commit into from
May 9, 2019

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented May 9, 2019

No allocation was made to perform the explicit deallocation. Doing so
causes a double free which the Windows C library caught.

No allocation was made to perform the explicit deallocation.  Doing so
causes a double free which the Windows C library caught.
@compnerd
Copy link
Member Author

compnerd commented May 9, 2019

CC: @millenomi

@compnerd
Copy link
Member Author

compnerd commented May 9, 2019

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented May 9, 2019

@swift-ci please test Linux platform

@compnerd
Copy link
Member Author

compnerd commented May 9, 2019

@millenomi and I discussed this offline. This is correct, the memory is owned by the NSValue, not by the consumer, so this is an invalid free. Going to merge this so that I can make a follow up change - @millenomi caught the fact that we have a lifetime problem here and need to extend the lifetime of the value to ensure that there is no use-after-free.

@compnerd compnerd merged commit 120f749 into swiftlang:master May 9, 2019
@compnerd compnerd deleted the double-double-toil-and-trouble branch May 9, 2019 17:00
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.

1 participant