microsoft / STL

MSVC's implementation of the C++ Standard Library.
Other
9.89k stars 1.45k forks source link

Avoid triggering ASan bug in `Dev09_056375_locale_cleanup` #4652

Closed CaseyCarter closed 1 month ago

CaseyCarter commented 1 month ago

Avoid triggering VSO-2046190 in Dev09_056375_locale_cleanup by leaving the DLL loaded in ASan instrumented statically-linked configs.

This test is failing with 17.10p5 and current dev compilers, I suspect due to a change in the ASan runtime's interception of memcpy. Recall that memcpy is part of VCRuntime, so statically-linked configs of this test have a copy of memcpy linked to the program and another copy of memcpy linked into the DLL. When the program unloads the DLL, I believe the ASan runtime's "pointer to actual memcpy" is left pointing into unallocated space where the DLL's copy used to be.

I'm going to disable unloading the DLL for this case to avoid the problem until we can implement and ship a fix.

CaseyCarter commented 1 month ago

/azp run STL-ASan-CI

azure-pipelines[bot] commented 1 month ago
Azure Pipelines successfully started running 1 pipeline(s).
CaseyCarter commented 1 month ago

STL-ASan-CI passed (after rerunning a sporadic x86 failure that I recorded in #4324).

StephanTLavavej commented 1 month ago

Thanks! :heart_eyes_cat: I updated the PR title to be more meaningful when scanning git history.

StephanTLavavej commented 1 month ago

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

StephanTLavavej commented 1 month ago

Thanks for scouting ahead and fixing this test for ASan before the next toolset update encountered it! :tada: :heart_eyes_cat: :magic_wand: