<div dir="ltr"><span lang="en-US"><font color="black" face="Tahoma"><span style="font-size:10pt" dir="ltr">Hello,<br>
<br>
I have been working on porting ASan to AArch64. I am building
compiler-rt in "standalone mode" targeting aarch64. My build is
successful, but I get the following runtime error when I run an ASan
enabled executable through qemu-aarch64:<br>
<br>
</span></font></span><br><span lang="en-US"><font color="black" face="Tahoma"><span style="font-size:10pt" dir="ltr"><span lang="en-US"><font color="black" face="Tahoma"><span style="font-size:10pt" dir="ltr"><font color="#333399">==29184==Parsed ASAN_OPTIONS: verbosity=1</font><font color="#333399"><br>
==29184==AddressSanitizer: failed to intercept '__isoc99_printf'</font><font color="#333399"><br>
==29184==AddressSanitizer: failed to intercept '__isoc99_sprintf'</font><font color="#333399"><br>
==29184==AddressSanitizer: failed to intercept '__isoc99_snprintf'</font><font color="#333399"><br>
==29184==AddressSanitizer: failed to intercept '__isoc99_fprintf'</font><font color="#333399"><br>
==29184==AddressSanitizer: failed to intercept '__isoc99_vprintf'</font><font color="#333399"><br>
==29184==AddressSanitizer: failed to intercept '__isoc99_vsprintf'</font><font color="#333399"><br>
==29184==AddressSanitizer: failed to intercept '__isoc99_vsnprintf'</font><font color="#333399"><br>
==29184==AddressSanitizer: failed to intercept '__isoc99_vfprintf'</font><font color="#333399"><br>
==29184==AddressSanitizer: libc interceptors initialized</font><font color="#333399"><br>
|| `[0x002000000000, 0x007fffffffff]` || HighMem ||</font><font color="#333399"><br>
|| `[0x001400000000, 0x001fffffffff]` || HighShadow ||</font><font color="#333399"><br>
|| `[0x001200000000, 0x0013ffffffff]` || ShadowGap ||</font><font color="#333399"><br>
|| `[0x001000000000, 0x0011ffffffff]` || LowShadow ||</font><font color="#333399"><br>
|| `[0x000000000000, 0x000fffffffff]` || LowMem ||</font><font color="#333399"><br>
MemToShadow(shadow): 0x001200000000 0x00123fffffff 0x001280000000 0x0013ffffffff</font><font color="#333399"><br>
redzone=16</font><font color="#333399"><br>
max_redzone=2048</font><font color="#333399"><br>
quarantine_size=256M</font><font color="#333399"><br>
malloc_context_size=30</font><font color="#333399"><br>
SHADOW_SCALE: 3</font><font color="#333399"><br>
SHADOW_GRANULARITY: 8</font><font color="#333399"><br>
SHADOW_OFFSET: 1000000000</font><font color="#333399"><br>
==29184==ERROR: AddressSanitizer failed to allocate 0xc00000000 (51539607552) bytes at address 1400000000 (errno: 12)</font><font color="#333399"><br>
==29184==ReserveShadowMemoryRange failed while trying to map 0xc00000000 bytes. Perhaps you're using ulimit -v</font></span></font></span>
<br>
<br>This appears to be the same issue discussed in this thread:<br>
<a href="https://mymail.qualcomm.com/owa/redir.aspx?C=k7Wv_sbf90SWPFjF3_Wzyp-KmK3QT9EI87JrUWjRxE-4GcylWFTmUnPhLYMjO_xSknvKZiQAOf8.&URL=https%3a%2f%2fcode.google.com%2fp%2faddress-sanitizer%2fissues%2fdetail%3fid%3d246%23makechanges" target="_blank">https://code.google.com/p/address-sanitizer/issues/detail?id=246#makechanges</a><br>
<br>
I contacted Christophe Lyon, and he said he had successfully ported ASan
to aarch64 and had committed a patch to enable this to LLVM:<br>
<a href="https://mymail.qualcomm.com/owa/redir.aspx?C=k7Wv_sbf90SWPFjF3_Wzyp-KmK3QT9EI87JrUWjRxE-4GcylWFTmUnPhLYMjO_xSknvKZiQAOf8.&URL=https%3a%2f%2fgithub.com%2fllvm-mirror%2fcompiler-rt%2fcommit%2f33465467e7f8243933100bab3cf8f34b79a8f54c" target="_blank">https://github.com/llvm-mirror/compiler-rt/commit/33465467e7f8243933100bab3cf8f34b79a8f54c</a><br>
<br>
His changes from this patch still appear to be configured correctly in
my build, so I am not sure why I am getting this error. Is anyone able
to shed some light on this?<br>
<br>
Thanks,<br>
-Gideon</span></font></span></div>