-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Runtime: Fix undersized allocation for out-of-line optional cast result. #4030
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
Conversation
We accounted for the size difference between T and T? in the inline case, but not the out-of-line case. rdar://problem/27671131
@swift-ci Please ASAN test |
@rjmccall, Does this look good for Swift 3? |
Could you add a targeted test for this issue? Because it only broke in one test, we only have incidental coverage for this codepath. |
Yes, this looks fine to me. I agree that it's easier to just unconditionally allocate an extra byte than to worry about whether there are extra inhabitants. |
Yeah, it might be cleaner to summon the |
This needs tests. |
It's exercised by the existing test suite. The tests that were failing on the ASAN bot appear to be passing now:
|
@jckarter Ok on the test... On another note, I don't think that the PR asan test works now. I think xin was looking into it but it is not clear to me if it was fixed. |
I do not believe the ASAN external bots are fixed. Those are machines not controlled by us and the radar got pushed back because of WWDC and other releases. |
These is incidental coverage. If someone changes how the infrastructure of those tests work, we will lose this coverage. |
@swift-ci test |
@swift-ci test linux |
1 similar comment
@swift-ci test linux |
@swift-ci test os x |
ASAN testing timed out. OS X testing failure may be infrastructure. Re-running with wiped workspace. |
From OS X:
|
@swift-ci test os x platform |
@tkremenek The ASAN bot at least tested the tests we were interested in. OS X is still failing on the same modulemap error, but that's almost definitely unrelated. |
@gribozavr Crafting a test that would reliably fail outside of asan will also require depending on incidental details of the allocator, AFAICT. |
@jckarter I'm not asking for a test that would fail outside of ASan -- failing only under ASan is fine (that's why we have that bot); just for a test that would cover this codepath, and that is not an emergent behavior in other tests. |
We accounted for the size difference between T and T? in the inline case, but not the out-of-line case. rdar://problem/27671131