Skip to content

[Runtime] Fix double-frees in ConcurrentReadableArray. #16794

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 May 23, 2018

I sort of forgot to clear out FreeList after destroying all the stuff inside it. The result is that the second time through, the same storage blocks would be destroyed again, resulting in a crash or worse.

This clears FreeList after destroying the stuff inside. It also adds a destructor so the thing doesn't leak when used as a non-global, and a basic test to verify that adding a non-trivial number of elements actually works.

Thanks to @gwynne for finding this.

rdar://problem/40484362

mikeash added 2 commits May 23, 2018 11:19
…apshots rather than using a callback-based read call.

rdar://problem/40230581
…ouble-free items. Also implement a destructor so it can be used for non-globals.

rdar://problem/40484362
@mikeash
Copy link
Contributor Author

mikeash commented May 23, 2018

@swift-ci please test

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