ASAN与gcc-5.2没有拦截异常

时间:2016-06-09 23:31:48

标签: exception gcc gcc5.2 address-sanitizer

过去两年我使用ASAN和gcc-4.8.2没有任何问题。我们转向gcc-5.2使用LSAN等新功能。使用gcc-5.2构建应用程序之后,它无法再拦截__cxa_throw导​​致崩溃,在运行ASAN后发现了这一点,其详细程度为= 1

==11314==AddressSanitizer: failed to intercept '__isoc99_printf'
==11314==AddressSanitizer: failed to intercept '__isoc99_sprintf'
==11314==AddressSanitizer: failed to intercept '__isoc99_snprintf'
==11314==AddressSanitizer: failed to intercept '__isoc99_fprintf'
==11314==AddressSanitizer: failed to intercept '__isoc99_vprintf'
==11314==AddressSanitizer: failed to intercept '__isoc99_vsprintf'
==11314==AddressSanitizer: failed to intercept '__isoc99_vsnprintf'
==11314==AddressSanitizer: failed to intercept '__isoc99_vfprintf'
==11314==AddressSanitizer: failed to intercept 'backtrace'
==11314==AddressSanitizer: failed to intercept '__cxa_throw'
==11314==AddressSanitizer: libc interceptors initialized
|| `[0x10007fff8000, 0x7fffffffffff]` || HighMem    ||
|| `[0x02008fff7000, 0x10007fff7fff]` || HighShadow ||
|| `[0x00008fff7000, 0x02008fff6fff]` || ShadowGap  ||
|| `[0x00007fff8000, 0x00008fff6fff]` || LowShadow  ||
|| `[0x000000000000, 0x00007fff7fff]` || LowMem     ||
MemToShadow(shadow): 0x00008fff7000 0x000091ff6dff 0x004091ff6e00 0x02008fff6fff
redzone=16
max_redzone=2048
quarantine_size=256M
malloc_context_size=30
SHADOW_SCALE: 3
SHADOW_GRANULARITY: 8
SHADOW_OFFSET: 7fff8000
==11314==Installed the sigaction for signal 11
==11314==T0: stack [0x7ffd377ce000,0x7ffd37fce000) size 0x800000; local=0x7ffd37fcb63c
==11314==AddressSanitizer Init done

是的,我们静态链接libstdc ++,但这不是gcc-4.8.2中的问题,其中ASAN能够正确拦截所有内容。

1 个答案:

答案 0 :(得分:0)

这是来自libasan的众所周知的虚假警告(例如https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58680),不幸的是,它很快就会被修复,如果有的话。但是你为什么要增加详细程度来运行阿桑?普通用户毕竟不应该对冗长的信息感兴趣。