Add address sanitizer annotations to UninitializedMemoryHacks.h when building with msvc 2022#1935
Add address sanitizer annotations to UninitializedMemoryHacks.h when building with msvc 2022#1935pps83 wants to merge 3 commits intofacebook:mainfrom
Conversation
|
check __sanitizer_annotate_contiguous_container in https://github.com/microsoft/STL/blob/main/stl/inc/string and https://github.com/microsoft/STL/blob/main/stl/inc/vector |
ef6e288 to
f6acdc4
Compare
|
@Orvid has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
FYI, it looks like in current version that ships with latest VS2022 asan annotations are commented out in |
f6acdc4 to
9dae19f
Compare
|
More fixes added (support for std::string annotations was added starting from _MSC_VER >= 1938) |
|
Has folly considered asking for an _Ugly member that does what they need rather than trying to incapability declare standard library parts? |
|
@Orvid has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@yfeldblum thanks for the review. I'm traveling in remote locations and rarely connect, so, will take some time before I can address it. There was also a suggestion by @BillyONeal and I think that would be a better approach. |
To be clear, while in the long term doing this with some mechanism that isn't a hack would have the benefit that it doesn't break every 3 seconds. That doesn't change that VS2022 17.8 is already out there which means Windows customers who want to use Folly are broken |
0c5be06 to
d6738c9
Compare
|
@yfeldblum all issues should be addressed |
|
|
|
@yfeldblum ping |
|
@Orvid has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1 similar comment
|
@Orvid has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
There are merge conflicts in this that need to be resolved before the tooling will let me import this PR. Would you be able to rebase this PR? |
give me a few mins |
d6738c9 to
fe54c3f
Compare
|
I rebased, but I didn't have any merge conflicts. @Orvid @yfeldblum |
|
@Orvid has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
Thanks, the import worked that time. Not sure why it was having issues before if there weren't merge conflicts. |
fe54c3f to
2673b49
Compare
40ceabf to
4778317
Compare

I use UninitializedMemoryHacks.h, but it adds lots of false positives when running with address sanitizer. I grepped MS includes and based on the version that comes with VS2022 I added these annotations. In my case, this fixed all the issues. I did check vs 2019 headers and didn't see the same annotation code used there.