These changes should be self-explanatory.
After the third patch is applied, the `futures` test fails AddresssSanitizer. I'm not sure if this is a separate Seastar bug, or a bug in this series.
The output is below.
Also available at
https://github.com/hakuch/seastar.git on the jhk/sanitizers_stuff/v1 branch.
$ ./test.py --mode=debug --verbose --name=futures
['cmake', '/home/jhaberku/src/seastar/build/debug', '-DSeastar_TEST_TIMEOUT=300', '-DSeastar_EXECUTE_ONLY_FAST_TESTS=no', '-DSeastar_UNIT_TEST_SMP=2', '-DSeastar_JENKINS=']
-- Boost version: 1.66.0
-- Found the following Boost libraries:
-- filesystem
-- program_options
-- thread
-- unit_test_framework
-- system
-- chrono
-- date_time
-- atomic
-- Could NOT find dpdk (missing: dpdk_INCLUDE_DIR dpdk_PMD_VMXNET3_UIO_LIBRARY dpdk_PMD_I40E_LIBRARY dpdk_PMD_IXGBE_LIBRARY dpdk_PMD_E1000_LIBRARY dpdk_PMD_BNXT_LIBRARY dpdk_PMD_RING_LIBRARY dpdk_PMD_CXGBE_LIBRARY dpdk_PMD_ENA_LIBRARY dpdk_PMD_ENIC_LIBRARY dpdk_PMD_FM10K_LIBRARY dpdk_PMD_NFP_LIBRARY dpdk_PMD_QEDE_LIBRARY dpdk_RING_LIBRARY dpdk_KVARGS_LIBRARY dpdk_MEMPOOL_LIBRARY dpdk_MEMPOOL_RING_LIBRARY dpdk_PMD_SFC_EFX_LIBRARY dpdk_HASH_LIBRARY dpdk_CMDLINE_LIBRARY dpdk_MBUF_LIBRARY dpdk_CFGFILE_LIBRARY dpdk_EAL_LIBRARY dpdk_ETHDEV_LIBRARY)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jhaberku/src/seastar/build/debug
['ctest', '/home/jhaberku/src/seastar/build/debug', '-E', 'Seastar.dist', '--verbose', '-R', 'futures']
UpdateCTestConfiguration from :/home/jhaberku/src/seastar/build/debug/DartConfiguration.tcl
UpdateCTestConfiguration from :/home/jhaberku/src/seastar/build/debug/DartConfiguration.tcl
Test project /home/jhaberku/src/seastar/build/debug
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 21
Start 21: Seastar.unit.futures
21: Test command: /usr/bin/cmake "--build" "/home/jhaberku/src/seastar/build/debug" "--target" "test_unit_futures_run"
21: Test timeout computed to be: 300
21: [0/1] cd /home/jhaberku/src/seastar/build/debug/tests/unit && /home/jhaberku/src/seastar/build/debug/tests/unit/futures -- -c 2
21: Reactor stalled for 2609 ms on shard 0.
21: Backtrace:
21: /lib64/libasan.so.5+0x000000000009d87b
21: 0x00000000010bbe18
21: 0x0000000001085fd9
21: 0x0000000000c2db66
21: 0x0000000000c40125
21: 0x0000000000c3cbbe
21: 0x0000000000c3cc78
21: 0x0000000000c3fd12
21: 0x00007f80083cd02f
21: 0x000000000094e37f
21: 0x00000000011cac92
21: 0x0000000001150336
21: 0x00000000010e0ce6
21: 0x000000000110fb1b
21: 0x00000000010b073a
21: 0x000000000106f040
21: 0x0000000000cc9e68
21: 0x00000000005d8ce1
21: 0x0000000000525f76
21: 0x0000000000442c82
21: 0x0000000000af20f8
21: 0x0000000000af31f6
21: 0x0000000000b1111a
21: 0x0000000000afb93a
21: 0x0000000000b04715
21: 0x0000000000b1111a
21: 0x0000000000af8f93
21: 0x0000000000b0c4d3
21: 0x0000000000cace1c
21: 0x0000000000cb24c5
21: 0x0000000000cba5e9
21: 0x0000000000b2a8a4
21: 0x0000000000afa266
21: 0x0000000000b060a0
21: 0x0000000000b73d96
21: 0x0000000000c182aa
21: /lib64/libpthread.so.0+0x000000000000858d
21: /lib64/libc.so.6+0x00000000000fd6a2
21: ==8871==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7f8002dfe880; bottom 0x7f7ffa671000; size: 0x00000878d880 (142137472)
21: False positive error reports may follow
21: For details see
https://github.com/google/sanitizers/issues/189
21: =================================================================
21: ==8871==ERROR: AddressSanitizer: stack-buffer-underflow on address 0x7f7ffa6728c0 at pc 0x00000082d469 bp 0x7f7ffa672760 sp 0x7f7ffa672750
21: WRITE of size 8 at 0x7f7ffa6728c0 thread T1
21: #0 0x82d468 in seastar::future_state<>::any::any() ../../include/seastar/core/future.hh:298
21: #1 0x82d528 in seastar::future_state<>::future_state() ../../include/seastar/core/future.hh:303
21: #2 0x8aa4d1 in seastar::continuation_base<>::continuation_base() ../../include/seastar/core/future.hh:397
21: #3 0x90954e in seastar::future<>::thread_wake_task::thread_wake_task(seastar::thread_context*, seastar::future<>*) ../../include/seastar/core/future.hh:892
21: #4 0x89f4de in seastar::future<>::do_wait() ../../include/seastar/core/future.hh:904
21: #5 0x46ac86 in seastar::future<>::get() ../../include/seastar/core/future.hh:852
21: #6 0x46ac86 in operator() ../../tests/unit/futures_test.cc:442
21: #7 0x6f2ffc in apply ../../include/seastar/core/apply.hh:35
21: #8 0x6f3076 in apply<test_parallel_for_each::run_test_case()::<lambda()> > ../../include/seastar/core/apply.hh:43
21: #9 0x6f3187 in apply_tuple<test_parallel_for_each::run_test_case()::<lambda()> > ../../include/seastar/core/future.hh:1343
21: #10 0x685c05 in apply<test_parallel_for_each::run_test_case()::<lambda()> > ../../include/seastar/core/future.hh:1377
21: #11 0x5f7246 in operator() ../../include/seastar/core/thread.hh:315
21: #12 0x7725c4 in _M_invoke /usr/include/c++/8/bits/std_function.h:297
21: #13 0xb73d96 in std::function<void ()>::operator()() const /usr/include/c++/8/bits/std_function.h:687
21: #14 0x14daa26 in seastar::thread_context::main() ../../src/core/thread.cc:317
21:
21: 0x7f7ffa6728c0 is located 129216 bytes inside of 135168-byte region [0x7f7ffa653000,0x7f7ffa674000)
21: allocated by thread T1 here:
21: #0 0x7f8008676420 in aligned_alloc (/lib64/libasan.so.5+0xf0420)
21: #1 0x14d5b8d in seastar::thread_context::make_stack() ../../src/core/thread.cc:173
21: #2 0x14d42b2 in seastar::thread_context::thread_context(seastar::thread_attributes, std::function<void ()>) ../../src/core/thread.cc:157
21: #3 0x6f351e in make_unique<seastar::thread_context, seastar::thread_attributes, seastar::async(seastar::thread_attributes, Func&&, Args&& ...) [with Func = test_parallel_for_each::run_test_case()::<lambda()>; Args = {}]::<lambda(seastar::async(seastar::thread_attributes, Func&&, Args&& ...) [with Func = test_parallel_for_each::run_test_case()::<lambda()>; Args = {}]::work&)> mutable::<lambda()>&> /usr/include/c++/8/bits/unique_ptr.h:831
21: #4 0x685d73 in thread<seastar::async(seastar::thread_attributes, Func&&, Args&& ...) [with Func = test_parallel_for_each::run_test_case()::<lambda()>; Args = {}]::<lambda(seastar::async(seastar::thread_attributes, Func&&, Args&& ...) [with Func = test_parallel_for_each::run_test_case()::<lambda()>; Args = {}]::work&)> mutable::<lambda()> > ../../include/seastar/core/thread.hh:261
21: #5 0x5f87cc in operator() ../../include/seastar/core/thread.hh:314
21: #6 0x5fa18e in do_with<seastar::async(seastar::thread_attributes, Func&&, Args&& ...) [with Func = test_parallel_for_each::run_test_case()::<lambda()>; Args = {}]::work, seastar::async(seastar::thread_attributes, Func&&, Args&& ...) [with Func = test_parallel_for_each::run_test_case()::<lambda()>; Args = {}]::<lambda(seastar::async(seastar::thread_attributes, Func&&, Args&& ...) [with Func = test_parallel_for_each::run_test_case()::<lambda()>; Args = {}]::work&)> > ../../include/seastar/core/do_with.hh:94
21: #7 0x5fc4d9 in async<test_parallel_for_each::run_test_case()::<lambda()> > ../../include/seastar/core/thread.hh:320
21: #8 0x54e4f1 in async<test_parallel_for_each::run_test_case()::<lambda()> > ../../include/seastar/core/thread.hh:336
21: #9 0x46e971 in test_parallel_for_each::run_test_case() ../../tests/unit/futures_test.cc:447
21: #10 0xaf20f8 in operator() ../../src/testing/seastar_test.cc:43
21: #11 0xaf31f6 in _M_invoke /usr/include/c++/8/bits/std_function.h:283
21: #12 0xb1111a in std::function<seastar::future<> ()>::operator()() const /usr/include/c++/8/bits/std_function.h:687
21: #13 0xafb93a in operator() ../../src/testing/test_runner.cc:88
21: #14 0xb04715 in _M_invoke /usr/include/c++/8/bits/std_function.h:283
21: #15 0xb1111a in std::function<seastar::future<> ()>::operator()() const /usr/include/c++/8/bits/std_function.h:687
21: #16 0xaf8f93 in operator() ../../src/testing/test_runner.cc:68
21: #17 0xb0c4d3 in run_and_dispose ../../include/seastar/core/future-util.hh:462
21: #18 0xcace1c in seastar::reactor::run_tasks(seastar::reactor::task_queue&) ../../src/core/reactor.cc:3524
21: #19 0xcb24c5 in seastar::reactor::run_some_tasks() ../../src/core/reactor.cc:3949
21: #20 0xcba5e9 in seastar::reactor::run() ../../src/core/reactor.cc:4092
21: #21 0xb2a8a4 in seastar::app_template::run_deprecated(int, char**, std::function<void ()>&&) ../../src/core/app-template.cc:185
21: #22 0xafa266 in operator() ../../src/testing/test_runner.cc:63
21: #23 0xb060a0 in _M_invoke /usr/include/c++/8/bits/std_function.h:297
21: #24 0xb73d96 in std::function<void ()>::operator()() const /usr/include/c++/8/bits/std_function.h:687
21: #25 0xc182aa in seastar::posix_thread::start_routine(void*) ../../src/core/posix.cc:52
21: #26 0x7f80083c258d in start_thread (/lib64/libpthread.so.0+0x858d)
21:
21: Thread T1 created by T0 here:
21: #0 0x7f80085d2043 in __interceptor_pthread_create (/lib64/libasan.so.5+0x4c043)
21: #1 0xc18c30 in seastar::posix_thread::posix_thread(seastar::posix_thread::attr, std::function<void ()>) ../../src/core/posix.cc:83
21: #2 0xc1845a in seastar::posix_thread::posix_thread(std::function<void ()>) ../../src/core/posix.cc:57
21: #3 0xb0004e in make_unique<seastar::posix_thread, seastar::testing::test_runner::start(int, char**)::<lambda()> > /usr/include/c++/8/bits/unique_ptr.h:831
21: #4 0xafa8f6 in seastar::testing::test_runner::start(int, char**) ../../src/testing/test_runner.cc:61
21: #5 0xaedb8f in init_unit_test_suite ../../src/testing/entry_point.cc:45
21: #6 0x7f800850fc4b (/lib64/libboost_unit_test_framework.so.1.66.0+0x54c4b)
21:
21: SUMMARY: AddressSanitizer: stack-buffer-underflow ../../include/seastar/core/future.hh:298 in seastar::future_state<>::any::any()
21: Shadow bytes around the buggy address:
21: 0x0ff07f4c64c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
21: 0x0ff07f4c64d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
21: 0x0ff07f4c64e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
21: 0x0ff07f4c64f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
21: 0x0ff07f4c6500: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f2
21: =>0x0ff07f4c6510: f2 f2 f2 f2 f2 f2 00 00[f1]f1 00 f2 f2 f2 f3 f3
21: 0x0ff07f4c6520: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00
21: 0x0ff07f4c6530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
21: 0x0ff07f4c6540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
21: 0x0ff07f4c6550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
21: 0x0ff07f4c6560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
21: Shadow byte legend (one shadow byte represents 8 application bytes):
21: Addressable: 00
21: Partially addressable: 01 02 03 04 05 06 07
21: Heap left redzone: fa
21: Freed heap region: fd
21: Stack left redzone: f1
21: Stack mid redzone: f2
21: Stack right redzone: f3
21: Stack after return: f5
21: Stack use after scope: f8
21: Global redzone: f9
21: Global init order: f6
21: Poisoned by user: f7
21: Container overflow: fc
21: Array cookie: ac
21: Intra object redzone: bb
21: ASan internal: fe
21: Left alloca redzone: ca
21: Right alloca redzone: cb
21: ==8871==ABORTING
21: FAILED: tests/unit/CMakeFiles/test_unit_futures_run
21: cd /home/jhaberku/src/seastar/build/debug/tests/unit && /home/jhaberku/src/seastar/build/debug/tests/unit/futures -- -c 2
21: ninja: build stopped: subcommand failed.
1/1 Test #21: Seastar.unit.futures .............***Failed 5.85 sec
0% tests passed, 1 tests failed out of 1
Total Test time (real) = 5.85 sec
The following tests FAILED:
21 - Seastar.unit.futures (Failed)
Errors while running CTest
Traceback (most recent call last):
File "./test.py", line 68, in <module>
run_tests(mode)
File "./test.py", line 65, in run_tests
subprocess.check_call(CTEST_ARGS, shell=False, cwd=BUILD_PATH)
File "/usr/lib64/python3.7/subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ctest', '/home/jhaberku/src/seastar/build/debug', '-E', 'Seastar.dist', '--verbose', '-R', 'futures']' returned non-zero exit status 8.
Compilation exited abnormally with code 1 at Mon Feb 4 12:22:33
Jesse Haber-Kucharsky (3):
build: Add the leak sanitizer
build: Make the use of sanitizers transitive
build: Allow sanitizers to be disabled
CMakeLists.txt | 48 ++++++++++++++++++++------------------
cmake/FindSanitizers.cmake | 18 ++++++++++++++
configure.py | 6 +++++
pkgconfig/
seastar.pc.in | 3 +--
4 files changed, 50 insertions(+), 25 deletions(-)
--
2.20.1