Modifying address-sanitizer to prevent threads from sharing memory

Hi Peter,

Yes, the idea sounds feasible.
You could use 8:1 or even smaller shadow.
E.g. if you can live with 64-byte aligned mallocs/allocas, you can have very compact 64:1 mapping,.
As you mention, having 1 byte shadow may be not 100% accurate, so you may chose 2 byte shadow (e.g. 64:2 mapping).
If you know that you will not have more than 64 threads (or 64 classes of plugins), you may have 64:8 mapping
(i.e. 64 bytes of application bytes map to 8 shadow bytes, and the shadow is a 64-bit bitmask of threads (plugin classes) that could touch this memory).

I wouldn’t try to modify the existing AddressSanitizer.cpp, but would write a new pass for your thesis.
If you need help with the asan code – just ask.