Skip to content
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

Don't assume that _Hash_vec's size and capacity are always equal #2774

Merged
merged 3 commits into from
Jun 12, 2022

Conversation

CaseyCarter
Copy link
Member

@CaseyCarter CaseyCarter commented Jun 9, 2022

The prior implementation that used vector directly had bugs that sometimes result in differing size and capacity. Since old and new code may link, we need to tolerate this condition.

Fixes DevCom-1190124/VSO-1220461/AB#1220461

The prior implementation that used `vector` directly had bugs that sometimes result in differing size and capacity. Since old and new code have may link, we need to tolerate this condition.

Fixes DevCom-1190124/VSO-1220461
@CaseyCarter CaseyCarter added the bug Something isn't working label Jun 9, 2022
@CaseyCarter CaseyCarter requested a review from a team as a code owner June 9, 2022 02:23
@CaseyCarter
Copy link
Member Author

My current thinking is that we can't test this non-intrusively, and any intrusive test would require more changes to the code than does the fix, so it's probably not worthwhile. I'm happy to hear any suggestions.

@CaseyCarter CaseyCarter changed the title Don't assume that _Hash_vec's size and capacity are always equal Don't assume that _Hash_vec's size and capacity are always equal Jun 9, 2022
stl/inc/xhash Outdated Show resolved Hide resolved
stl/inc/xhash Outdated Show resolved Hide resolved
stl/inc/xhash Show resolved Hide resolved
stl/inc/xhash Show resolved Hide resolved
stl/inc/xhash Outdated Show resolved Hide resolved
@StephanTLavavej StephanTLavavej self-assigned this Jun 10, 2022
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 77a9b2e into microsoft:main Jun 12, 2022
@StephanTLavavej
Copy link
Member

Thanks for finding out how to fix this bincompat break! 🏚️ 🛠️ 🏡

@CaseyCarter CaseyCarter deleted the hash_vec-capacity branch June 13, 2022 22:25
@malcolmdavey
Copy link

Can this be fixed for 2019 16.11 STL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

<xhash>: linking libs built with VS2017 into client code built with vs2019 can cause subtle memory corruption
3 participants