Open
Description
ASan changes size of global variables by appending redzone size to it. This may cause runtime errors when/if other shared modules have been linked against non-sanitized version of the library.
Here is an example:
$ cat tmp.c
char xxx = 0;
$ clang tmp.c -shared -fPIC
$ readelf -sDW a.out | grep xxx
8 0: 0000000000201034 1 OBJECT GLOBAL DEFAULT 21 xxx
$ clang tmp.c -shared -fPIC -fsanitize=address
$ readelf -sDW a.out | grep xxx
11 0: 00000000002010a0 64 OBJECT GLOBAL DEFAULT 23 xxx
So perhaps we could come up with a less invasive way to fix sanitization of globals on Mac?