We wrestled a lot with this in Hyperscan and finally came to the conclusion that you can't be Valgrind/ASAN-dirty even when you're writing correct code. Not if you're a library, anyhow. It's a pain as it has a way of doubling your LOC in SIMD loops. "Oh, and now the dumb bit".
In the future, masked loads that don't fault off the page will be literally everywhere - it's literally the instruction everyone will have to call when doing loads on AVX-512. So what then?
-
-
It isn't clear to me if you are talking about multi-instruction masking idioms like "load this, AND away some bytes" or actual all-in-one masked instructions like vmaskmov. I 100% agree the latter should not be flagged by ASAN if the included portion of the read is in-bounds.
-
... and as far as I know ASAN has added support for those. In the former case though, the idea of a masked load is only a convention which could be detected but not exhaustively. IMO good support for whitelisting functions or even individual statements seems like an OK solution.
End of conversation
New conversation -
-
-
I assume the behavior will be the same for unmasked (K0) loads which will remain the majority of loads. I would expect ASAN to have good support for masked loads as well since compilers will probably start generating them (icc already does even before AVX512).
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.