Skip to content

Instantly share code, notes, and snippets.

@kwk
Created September 29, 2020 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwk/d12dc029b0c55eb1f6ccb9c48518d182 to your computer and use it in GitHub Desktop.
Save kwk/d12dc029b0c55eb1f6ccb9c48518d182 to your computer and use it in GitHub Desktop.
sanitizer-issue in gdb
sh-5.0$ cd build
sh-5.0$ LSAN_OPTIONS=verbosity=1:log_threads=1 lldb ./a.out
sh: lldb: command not found
sh-5.0$ LSAN_OPTIONS=verbosity=1:log_threads=1 gdb ./a.out
GNU gdb (GDB) Fedora 9.1-6.fc32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./a.out...
(gdb) r
Starting program: /home/worker/build/a.out
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.31-2.fc32.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
==10369==AddressSanitizer: failed to intercept '__isoc99_printf'
'==10369==AddressSanitizer: failed to intercept '__isoc99_sprintf'
'==10369==AddressSanitizer: failed to intercept '__isoc99_snprintf'
'==10369==AddressSanitizer: failed to intercept '__isoc99_fprintf'
'==10369==AddressSanitizer: failed to intercept '__isoc99_vprintf'
'==10369==AddressSanitizer: failed to intercept '__isoc99_vsprintf'
'==10369==AddressSanitizer: failed to intercept '__isoc99_vsnprintf'
'==10369==AddressSanitizer: failed to intercept '__isoc99_vfprintf'
'==10369==AddressSanitizer: failed to intercept 'xdr_quad_t'
'==10369==AddressSanitizer: failed to intercept 'xdr_u_quad_t'
'==10369==AddressSanitizer: failed to intercept 'xdr_destroy'
'==10369==AddressSanitizer: failed to intercept 'crypt'
'==10369==AddressSanitizer: failed to intercept 'crypt_r'
'==10369==AddressSanitizer: failed to intercept '__cxa_throw'
'==10369==AddressSanitizer: failed to intercept '__cxa_rethrow_primary_exception'
'==10369==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_mb=256M
thread_local_quarantine_size_kb=1024K
malloc_context_size=30
SHADOW_SCALE: 3
SHADOW_GRANULARITY: 8
SHADOW_OFFSET: 0x7fff8000
==10369==Installed the sigaction for signal 11
==10369==Installed the sigaction for signal 7
==10369==Installed the sigaction for signal 8
==10369==T0: stack [0x7fffff7ff000,0x7ffffffff000) size 0x800000; local=0x7fffffffe4bc
==10369==AddressSanitizer Init done
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7cf78e4 in strxfrm_l () from /lib64/libc.so.6
Missing separate debuginfos, use: dnf debuginfo-install libgcc-10.2.1-1.fc32.x86_64
(gdb) bt
#0 0x00007ffff7cf78e4 in strxfrm_l () from /lib64/libc.so.6
#1 0x00000000004943f9 in __interceptor_strxfrm_l (dest=0x7fffffffe380 "\377\377\377\377\377\177", src=0x509180 <str> "qwerty",
len=100, locale=0x0)
at /home/worker/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:6953
#2 0x00000000004f5d6c in main () at strxfrm.c:15
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment