Segmentation fault in some clients with __clear_cache
On AArch64 some dynamic code operations cause a crash in (or with) clients:
#include <stdlib.h>
int main(void) {
void *page;
posix_memalign(&page, 4096, 4096);
__builtin___clear_cache(page, (char*)page + 4096);
return 0;
}
this gets a segmentation fault with simple clients like libbbcount and libopcodes. The debug build says
<Application tried to execute from unreadable memory 0x0000000000000000.
We know DR on AArch64 traps IC IVAU in order to handle dynamic code, so maybe there's some interaction between that and the instrumentation that these clients are putting in.