confio, stack-buffer-overflow
]% ./tests/confio
ok 1 - Prepare configuration
# conf_io_begin
ok 2 - begin child txn with no parent
ok 3 - check txn depth
ok 4 - begin parent txn
ok 5 - check txn depth
ok 6 - begin another parent txn
ok 7 - check txn depth
ok 8 - begin child txn
ok 9 - check txn depth
ok 10 - begin child txn
ok 11 - check txn depth
ok 12 - begin child txn
ok 13 - check txn depth
ok 14 - begin child txn
ok 15 - check txn depth
ok 16 - begin another child txn
ok 17 - check txn depth
ok 18 - abort parent txn
ok 19 - check txn depth
# conf_io_abort
ok 20 - abort no txn
ok 21 - abort no txn
ok 22 - begin parent txn
ok 23 - begin child txn
=================================================================
==4190==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffe719039f1 at pc 0x561c81747f5c bp 0x7ffe71903460 sp 0x7ffe71902c20
READ of size 2 at 0x7ffe719039f1 thread T0
#0 0x561c81747f5b in __interceptor_strlen /home/nikola/final/llvm.src/projects/compiler-rt/lib/asan/asan_interceptors.cc:609:5
#1 0x561c818aecd9 in yp_scheme_check_str /home/fcelda/devel/knot/src/libknot/yparser/ypscheme.c:406:37
#2 0x561c817da0ca in conf_io_set /home/fcelda/devel/knot/src/knot/conf/confio.c:815:12
#3 0x561c81782beb in test_conf_io_abort /home/fcelda/devel/knot/tests/confio.c:103:6
#4 0x561c81781e60 in main /home/fcelda/devel/knot/tests/confio.c:813:2
#5 0x7f4e6f4f857f in __libc_start_main (/lib64/libc.so.6+0x2057f)
#6 0x561c816cbd28 in _start (/home/fcelda/devel/knot/tests/confio+0x85d28)
Address 0x7ffe719039f1 is located in stack of thread T0 at offset 177 in frame
#0 0x561c8178280f in test_conf_io_abort /home/fcelda/devel/knot/tests/confio.c:89
This frame has 6 object(s):
[32, 136) 'io'
[176, 177) 'idx' <== Memory access at offset 177 overflows this variable
[192, 240) 'val'
[272, 320) 'val3'
[352, 400) ''
[432, 480) ''
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
(longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow /home/nikola/final/llvm.src/projects/compiler-rt/lib/asan/asan_interceptors.cc:609:5 in __interceptor_strlen
Shadow bytes around the buggy address:
0x10004e3186e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10004e3186f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10004e318700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10004e318710: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10004e318720: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00
=>0x10004e318730: 00 00 00 00 00 00 00 00 00 f2 f2 f2 f2 f2[01]f2
0x10004e318740: 00 00 00 00 00 00 f2 f2 f2 f2 00 00 00 00 00 00
0x10004e318750: f2 f2 f2 f2 00 00 00 00 00 00 f2 f2 f2 f2 00 00
0x10004e318760: 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00 00 00
0x10004e318770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10004e318780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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
==4190==ABORTING