Skip to content

: Correctly pass target size, not size change to ASan annotator - #2420

Merged
Stephan T. Lavavej (StephanTLavavej) merged 2 commits into
microsoft:mainfrom
cbezault:main
Dec 17, 2021
Merged

Stephan T. Lavavej (StephanTLavavej) merged 2 commits into
microsoft:mainfrom
cbezault:main

Conversation

@cbezault

Copy link
Copy Markdown
Contributor

Jonathan Emmett (@joemmett) experienced ASan errors while attempting to build and run the compiler under ASan after my ASan vector change.
Upon inspection of the failure point Casey Carter (@CaseyCarter) noticed that we were passing the change of the size to the ASan annotator guard instead of the absolute target size in both _Resize and assign.

Casey and I also would like to see more vector tests running with ASan turned on but it is difficult to insert /fsanitize=address into an arbitrary matrix because it currently only supports the default IDLs and clang-cl currently does not support debug flavors of the CRT.

@cbezault Curtis J Bezault (cbezault) added bug Something isn't working high priority Important! labels Dec 14, 2021
@cbezault
Curtis J Bezault (cbezault) requested a review from a team as a code owner December 14, 2021 19:48
Comment thread stl/inc/vector
@StephanTLavavej

Copy link
Copy Markdown
Member

I think we should consider renaming _Asan_extend_guard/_ASAN_VECTOR_EXTEND_GUARD since the "absolute size" usage is not obvious, especially when _Modify_annotation/_ASAN_VECTOR_MODIFY takes a relative size. However, that can be done in another PR.

@cbezault

Copy link
Copy Markdown
Contributor Author

Thanks for the quick review guys.

@cbezault

Copy link
Copy Markdown
Contributor Author

Stephan T. Lavavej (@StephanTLavavej) I totally agree. I think I named it extend guard because I had gotten mixed up between refactors whether it took a new absolute size or a delta, which is exactly the same refactor that missed these three call sites.

@StephanTLavavej

Copy link
Copy Markdown
Member

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

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 303df3d into microsoft:main Dec 17, 2021
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks Curtis J Bezault (@cbezault), Jonathan Emmett (@joemmett), and Casey Carter (@CaseyCarter) for finding and fixing this bug! 🐞 ✅ 😻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working high priority Important!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants