http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60681
Bug ID: 60681 Summary: Libbacktrace library doesn't work with QEMU in application mode Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: chefmax at gcc dot gnu.org CC: v.garbuzov at samsung dot com, y.gribov at samsung dot com The libbacktrace library doesn't work well with QEMU in application mode. $ arm-linux-gnueabi-gcc -fsanitize=address -g gcc/testsuite/c-c++-common/asan/null-deref-1.c $ qemu-arm -cpu cortex-a15 -L /home/max/install/gcc-upstream-arm/arm-linux-gnueabi/sys-root/ -R 0 -E LD_LIBRARY_PATH=/home/max/install/gcc-upstream-arm/arm-linux-gnueabi/lib/ ./a.out ... #0 0x873f (/home/max/build/gcc-upstream-arm/a.out+0x873f) #1 0x876f (/home/max/build/gcc-upstream-arm/a.out+0x876f) #2 0x40ddb507 (/lib/libc.so.6+0x18507) When running the same binary on the target board, libbacktrace works well: -sh-4.1$ ./a.out ... #0 0x873f in NullDeref /home/m.ostapenko/null-deref-1.c:10 #1 0x876f in main /home/m.ostapenko/null-deref-1.c:15 #2 0xb6855507 in __libc_start_main /home/max/build.arm.cortex-a15/sources/glibc/libc/csu/libc-start.c:269 After investigation I discovered that libbacktrace scans /proc/self/exe to init symbolizer and in QEMU case it finds information about qemu-arm binary itself, not a.out. Is it a real bug or we should leave this as it is now? Perhaps I should report this to QEMU developers?