|
row->set_value(W_ID, wid); |
I believe that instead of
row->set_value(W_ID, wid);
we can have
int64_t w_id = wid;
row->set_value(W_ID, &w_id);
=================================================================
==122642==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff229ece64 at pc 0x7ffa528e369a bp 0x7fff229ecde0 sp 0x7fff229ec588
READ of size 8 at 0x7fff229ece64 thread T0
#0 0x7ffa528e3699 in __interceptor_memcpy ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:823
#1 0x55f01952c9f2 in row_t::set_value(int, void*) storage/row.cpp:90
#2 0x55f01952cece in row_t::set_value(int, unsigned int) storage/row.cpp:106
#3 0x55f019502cab in tpcc_wl::init_tab_wh(unsigned int) benchmarks/tpcc_wl.cpp:119
#4 0x55f01950672d in tpcc_wl::threadInitWarehouse(void*) benchmarks/tpcc_wl.cpp:399
#5 0x55f019502240 in tpcc_wl::init_table() benchmarks/tpcc_wl.cpp:72
#6 0x55f019500689 in tpcc_wl::init() benchmarks/tpcc_wl.cpp:27
#7 0x55f019542a78 in main system/main.cpp:44
#8 0x7ffa523620b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
#9 0x55f0194f9f2d in _start (/workspace/concurrency/code/2plsf/DBx1000/rundb+0x17f2d)
Address 0x7fff229ece64 is located in stack of thread T0 at offset 36 in frame
#0 0x55f01952ce25 in row_t::set_value(int, unsigned int) storage/row.cpp:106
This frame has 1 object(s):
[32, 36) 'value' (line 106) <== Memory access at offset 36 overflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
(longjmp and C++ exceptions are supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:823 in __interceptor_memcpy
Shadow bytes around the buggy address:
0x100064535970: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100064535980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100064535990: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000645359a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000645359b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x1000645359c0: 00 00 00 00 00 00 00 00 f1 f1 f1 f1[04]f3 f3 f3
0x1000645359d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
0x1000645359e0: f1 f1 00 00 00 f2 00 00 00 f2 f2 f2 02 f2 00 01
0x1000645359f0: f2 f2 00 02 f2 f2 00 00 04 f3 f3 f3 f3 f3 00 00
0x100064535a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100064535a10: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
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
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
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
Shadow gap: cc
DBx1000/benchmarks/tpcc_wl.cpp
Line 118 in 5f172a9
I believe that instead of
row->set_value(W_ID, wid);
we can have
int64_t w_id = wid;
row->set_value(W_ID, &w_id);
=================================================================
==122642==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff229ece64 at pc 0x7ffa528e369a bp 0x7fff229ecde0 sp 0x7fff229ec588
READ of size 8 at 0x7fff229ece64 thread T0
#0 0x7ffa528e3699 in __interceptor_memcpy ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:823
#1 0x55f01952c9f2 in row_t::set_value(int, void*) storage/row.cpp:90
#2 0x55f01952cece in row_t::set_value(int, unsigned int) storage/row.cpp:106
#3 0x55f019502cab in tpcc_wl::init_tab_wh(unsigned int) benchmarks/tpcc_wl.cpp:119
#4 0x55f01950672d in tpcc_wl::threadInitWarehouse(void*) benchmarks/tpcc_wl.cpp:399
#5 0x55f019502240 in tpcc_wl::init_table() benchmarks/tpcc_wl.cpp:72
#6 0x55f019500689 in tpcc_wl::init() benchmarks/tpcc_wl.cpp:27
#7 0x55f019542a78 in main system/main.cpp:44
#8 0x7ffa523620b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
#9 0x55f0194f9f2d in _start (/workspace/concurrency/code/2plsf/DBx1000/rundb+0x17f2d)
Address 0x7fff229ece64 is located in stack of thread T0 at offset 36 in frame
#0 0x55f01952ce25 in row_t::set_value(int, unsigned int) storage/row.cpp:106
This frame has 1 object(s):
[32, 36) 'value' (line 106) <== Memory access at offset 36 overflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
(longjmp and C++ exceptions are supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:823 in __interceptor_memcpy
Shadow bytes around the buggy address:
0x100064535970: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100064535980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100064535990: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000645359a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000645359b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x1000645359c0: 00 00 00 00 00 00 00 00 f1 f1 f1 f1[04]f3 f3 f3
0x1000645359d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
0x1000645359e0: f1 f1 00 00 00 f2 00 00 00 f2 f2 f2 02 f2 00 01
0x1000645359f0: f2 f2 00 02 f2 f2 00 00 04 f3 f3 f3 f3 f3 00 00
0x100064535a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100064535a10: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
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
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
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
Shadow gap: cc