Skip to content

Instantly share code, notes, and snippets.

@MarkLodato
Last active August 29, 2015 14:20
Show Gist options
  • Save MarkLodato/437a6deec280a6e8c68b to your computer and use it in GitHub Desktop.
Save MarkLodato/437a6deec280a6e8c68b to your computer and use it in GitHub Desktop.
Address sanitizer report
▶ bzr revno
646
▶ make CC=clang CFLAGS='-fsanitize=address -fno-omit-frame-pointer -g -O1'
▶ for x in ~/p/vt100-to-html/test/*.in; bin/unterm $x >/dev/null || echo $x
=================================================================
==7091==ERROR: AddressSanitizer: negative-size-param: (size=-20)
#0 0x4a611d in __asan_memmove (/home/mark/tmp/libvterm/bin/.libs/lt-unterm+0x4a611d)
#1 0x7ff6a1fc9a11 in scroll /home/mark/tmp/libvterm/src/state.c:92:7
#2 0x7ff6a1fc4624 in on_csi /home/mark/tmp/libvterm/src/state.c:1306:5
#3 0x7ff6a1fcc88d in do_string_csi /home/mark/tmp/libvterm/src/parser.c:100:10
#4 0x7ff6a1fcc1ff in do_string /home/mark/tmp/libvterm/src/parser.c:162:5
#5 0x7ff6a1fcba2c in vterm_input_write /home/mark/tmp/libvterm/src/parser.c:295:9
#6 0x4dcea1 in main /home/mark/tmp/libvterm/bin/unterm.c:237:5
#7 0x7ff6a10caa3f in __libc_start_main /build/buildd/glibc-2.21/csu/libc-start.c:289
#8 0x4353c8 in _start (/home/mark/tmp/libvterm/bin/.libs/lt-unterm+0x4353c8)
0x60b00000af58 is located 120 bytes inside of 100-byte region [0x60b00000aee0,0x60b00000af44)
allocated by thread T0 here:
#0 0x4bc392 in __interceptor_malloc (/home/mark/tmp/libvterm/bin/.libs/lt-unterm+0x4bc392)
#1 0x7ff6a1fd673e in default_malloc /home/mark/tmp/libvterm/src/vterm.c:14:15
#2 0x7ff6a1fbfd02 in vterm_obtain_state /home/mark/tmp/libvterm/src/state.c:1519:21
#3 0x7ff6a1fcd884 in screen_new /home/mark/tmp/libvterm/src/screen.c:617:23
#4 0x7ff6a1fcd7d7 in vterm_obtain_screen /home/mark/tmp/libvterm/src/screen.c:813:25
#5 0x4dce64 in main /home/mark/tmp/libvterm/bin/unterm.c:229:9
#6 0x7ff6a10caa3f in __libc_start_main /build/buildd/glibc-2.21/csu/libc-start.c:289
SUMMARY: AddressSanitizer: negative-size-param ??:0 __asan_memmove
==7091==ABORTING
/home/mark/p/vt100-to-html/test/t0016-SU.in
=================================================================
==7587==ERROR: AddressSanitizer: negative-size-param: (size=-72)
#0 0x4a611d in __asan_memmove (/home/mark/tmp/libvterm/bin/.libs/lt-unterm+0x4a611d)
#1 0x7f3439515a11 in scroll /home/mark/tmp/libvterm/src/state.c:92:7
#2 0x7f3439510624 in on_csi /home/mark/tmp/libvterm/src/state.c:1306:5
#3 0x7f343951888d in do_string_csi /home/mark/tmp/libvterm/src/parser.c:100:10
#4 0x7f34395181ff in do_string /home/mark/tmp/libvterm/src/parser.c:162:5
#5 0x7f3439517a2c in vterm_input_write /home/mark/tmp/libvterm/src/parser.c:295:9
#6 0x4dcea1 in main /home/mark/tmp/libvterm/bin/unterm.c:237:5
#7 0x7f3438616a3f in __libc_start_main /build/buildd/glibc-2.21/csu/libc-start.c:289
#8 0x4353c8 in _start (/home/mark/tmp/libvterm/bin/.libs/lt-unterm+0x4353c8)
0x60b00000af40 is located 96 bytes inside of 100-byte region [0x60b00000aee0,0x60b00000af44)
allocated by thread T0 here:
#0 0x4bc392 in __interceptor_malloc (/home/mark/tmp/libvterm/bin/.libs/lt-unterm+0x4bc392)
#1 0x7f343952273e in default_malloc /home/mark/tmp/libvterm/src/vterm.c:14:15
#2 0x7f343950bd02 in vterm_obtain_state /home/mark/tmp/libvterm/src/state.c:1519:21
#3 0x7f3439519884 in screen_new /home/mark/tmp/libvterm/src/screen.c:617:23
#4 0x7f34395197d7 in vterm_obtain_screen /home/mark/tmp/libvterm/src/screen.c:813:25
#5 0x4dce64 in main /home/mark/tmp/libvterm/bin/unterm.c:229:9
#6 0x7f3438616a3f in __libc_start_main /build/buildd/glibc-2.21/csu/libc-start.c:289
SUMMARY: AddressSanitizer: negative-size-param ??:0 __asan_memmove
==7587==ABORTING
/home/mark/p/vt100-to-html/test/t0076-DECSTBM_IL_DL.in
=================================================================
==7602==ERROR: AddressSanitizer: negative-size-param: (size=-60)
#0 0x4a611d in __asan_memmove (/home/mark/tmp/libvterm/bin/.libs/lt-unterm+0x4a611d)
#1 0x7f862bedca11 in scroll /home/mark/tmp/libvterm/src/state.c:92:7
#2 0x7f862bed7624 in on_csi /home/mark/tmp/libvterm/src/state.c:1306:5
#3 0x7f862bedf88d in do_string_csi /home/mark/tmp/libvterm/src/parser.c:100:10
#4 0x7f862bedf1ff in do_string /home/mark/tmp/libvterm/src/parser.c:162:5
#5 0x7f862bedea2c in vterm_input_write /home/mark/tmp/libvterm/src/parser.c:295:9
#6 0x4dcea1 in main /home/mark/tmp/libvterm/bin/unterm.c:237:5
#7 0x7f862afdda3f in __libc_start_main /build/buildd/glibc-2.21/csu/libc-start.c:289
#8 0x4353c8 in _start (/home/mark/tmp/libvterm/bin/.libs/lt-unterm+0x4353c8)
0x60b00000af1c is located 60 bytes inside of 100-byte region [0x60b00000aee0,0x60b00000af44)
allocated by thread T0 here:
#0 0x4bc392 in __interceptor_malloc (/home/mark/tmp/libvterm/bin/.libs/lt-unterm+0x4bc392)
#1 0x7f862bee973e in default_malloc /home/mark/tmp/libvterm/src/vterm.c:14:15
#2 0x7f862bed2d02 in vterm_obtain_state /home/mark/tmp/libvterm/src/state.c:1519:21
#3 0x7f862bee0884 in screen_new /home/mark/tmp/libvterm/src/screen.c:617:23
#4 0x7f862bee07d7 in vterm_obtain_screen /home/mark/tmp/libvterm/src/screen.c:813:25
#5 0x4dce64 in main /home/mark/tmp/libvterm/bin/unterm.c:229:9
#6 0x7f862afdda3f in __libc_start_main /build/buildd/glibc-2.21/csu/libc-start.c:289
SUMMARY: AddressSanitizer: negative-size-param ??:0 __asan_memmove
==7602==ABORTING
/home/mark/p/vt100-to-html/test/t0077-DECSTBM_quirks.in
=================================================================
==7677==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000efef at pc 0x7fac81cb4efa bp 0x7ffe2681b530 sp 0x7ffe2681b528
READ of size 1 at 0x60200000efef thread T0
#0 0x7fac81cb4ef9 in is_col_tabstop /home/mark/tmp/libvterm/src/state.c:150:10
#1 0x7fac81cb3c83 in tab /home/mark/tmp/libvterm/src/state.c:159:10
#2 0x7fac81cb0912 in on_csi /home/mark/tmp/libvterm/src/state.c:926:5
#3 0x7fac81cb688d in do_string_csi /home/mark/tmp/libvterm/src/parser.c:100:10
#4 0x7fac81cb61ff in do_string /home/mark/tmp/libvterm/src/parser.c:162:5
#5 0x7fac81cb5a2c in vterm_input_write /home/mark/tmp/libvterm/src/parser.c:295:9
#6 0x4dcea1 in main /home/mark/tmp/libvterm/bin/unterm.c:237:5
#7 0x7fac80db4a3f in __libc_start_main /build/buildd/glibc-2.21/csu/libc-start.c:289
#8 0x4353c8 in _start (/home/mark/tmp/libvterm/bin/.libs/lt-unterm+0x4353c8)
0x60200000efef is located 1 bytes to the left of 10-byte region [0x60200000eff0,0x60200000effa)
allocated by thread T0 here:
#0 0x4bc392 in __interceptor_malloc (/home/mark/tmp/libvterm/bin/.libs/lt-unterm+0x4bc392)
#1 0x7fac81cc073e in default_malloc /home/mark/tmp/libvterm/src/vterm.c:14:15
#2 0x7fac81ca9cb0 in vterm_obtain_state /home/mark/tmp/libvterm/src/state.c:1517:21
#3 0x7fac81cb7884 in screen_new /home/mark/tmp/libvterm/src/screen.c:617:23
#4 0x7fac81cb77d7 in vterm_obtain_screen /home/mark/tmp/libvterm/src/screen.c:813:25
#5 0x4dce64 in main /home/mark/tmp/libvterm/bin/unterm.c:229:9
#6 0x7fac80db4a3f in __libc_start_main /build/buildd/glibc-2.21/csu/libc-start.c:289
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/mark/tmp/libvterm/src/state.c:150 is_col_tabstop
Shadow bytes around the buggy address:
0x0c047fff9da0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9db0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9dc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9dd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9de0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c047fff9df0: fa fa fa fa fa fa fa fa fa fa fa fa fa[fa]00 02
0x0c047fff9e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9e10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9e20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9e30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9e40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==7677==ABORTING
/home/mark/p/vt100-to-html/test/t0084-CBT.in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment