Skip to content

[Runtime] Fix unowned refcount overflow to side table during deinit. #14283

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 Jan 30, 2018

32-bit has a 7-bit inline unowned refcount, then 31 bits in the side table. Overflowing the inline count in deinit on an object that didn't already have a side table would crash, because the code assumed that creating a side table in deinit was not allowed.

(64-bit has 31 bits inline and in the side table. Overflowing the inline count immediately overflows the side table as well, so there's no change in behavior there.)

rdar://problem/33765960

32-bit has a 7-bit inline unowned refcount, then 31 bits in the side table. Overflowing the inline count in deinit on an object that didn't already have a side table would crash, because the code assumed that creating a side table in deinit was not allowed.

(64-bit has 31 bits inline and in the side table. Overflowing the inline count immediately overflows the side table as well, so there's no change in behavior there.)

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

mikeash commented Jan 30, 2018

@swift-ci please test

1 similar comment
@mikeash
Copy link
Contributor Author

mikeash commented Mar 21, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 13466e0a1a21eff46f56a485afdbcb414d27f712

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 13466e0a1a21eff46f56a485afdbcb414d27f712

@mikeash mikeash force-pushed the fix-urc-overflow-to-side-table-in-deinit branch from 13466e0 to b4daf81 Compare March 21, 2018 22:29
@mikeash mikeash force-pushed the fix-urc-overflow-to-side-table-in-deinit branch from b4daf81 to ed4e3b9 Compare March 21, 2018 23:00
@mikeash
Copy link
Contributor Author

mikeash commented Mar 21, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 13466e0a1a21eff46f56a485afdbcb414d27f712

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 13466e0a1a21eff46f56a485afdbcb414d27f712

@mikeash mikeash merged commit cf3ee98 into swiftlang:master Mar 22, 2018
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