cmu-db / peloton

The Self-Driving Database Management System
http://pelotondb.io
Apache License 2.0
2.04k stars 622 forks source link

query_logger_test failure #1307

Open pervazea opened 6 years ago

pervazea commented 6 years ago

On Jenkins, has leaks when running under the address sanitizer Seen in several recent builds. Extract of logs from PR-1271 appended.

This seems to be reporting that the leaks are from: .../src/brain/query_logger.cpp:37

The symptom is as if the transaction is not committed, but the code in this file does terminate the transaction.

I am unable to reproduce this on my machine.

Start  13: query_logger_test

13: Test command: /tmp/workspace/peloton_PR-1271-OTJTL66AGB2C26ZL6NIM4XVKJGQQTMZYVGTE2PEWOG5PXARBHSLQ/build/test/query_logger_test "--gtest_color=yes" "--gtest_output=xml:/tmp/workspace/peloton_PR-1271-OTJTL66AGB2C26ZL6NIM4XVKJGQQTMZYVGTE2PEWOG5PXARBHSLQ/build/test/query_logger_test.xml" 13: Environment variables: 13: LSAN_OPTIONS=suppressions=/tmp/workspace/peloton_PR-1271-OTJTL66AGB2C26ZL6NIM4XVKJGQQTMZYVGTE2PEWOG5PXARBHSLQ/test/leak_suppr.txt 13: Test timeout computed to be: 9.99988e+06 13: Running main() from gmock_main.cc 13: [==========] Running 1 test from 1 test case. 13: [----------] Global test environment set-up. 13: [----------] 1 test from QueryLoggerTests 13: [ RUN ] QueryLoggerTests.QueriesTest 13: 2018-04-18 14:27:17 [test/sql/testing_sql_util.cpp:58:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM pg_catalog.pg_query_history; 13: 2018-04-18 14:27:18 [src/codegen/operator/table_scan_translator.cpp:40:TableScanTranslator] DEBUG - Constructing TableScanTranslator ... 13: 2018-04-18 14:27:18 [src/codegen/operator/table_scan_translator.cpp:53:TableScanTranslator] DEBUG - Finished constructing TableScanTranslator ... 13: 2018-04-18 14:27:18 [test/sql/testing_sql_util.cpp:93:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS 13: 2018-04-18 14:27:20 [test/sql/testing_sql_util.cpp:58:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM pg_catalog.pg_query_history; 13: 2018-04-18 14:27:20 [test/sql/testing_sql_util.cpp:93:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS 13: 2018-04-18 14:27:22 [test/sql/testing_sql_util.cpp:58:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM pg_catalog.pg_query_history; 13: 2018-04-18 14:27:22 [test/sql/testing_sql_util.cpp:93:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS 13: 2018-04-18 14:27:24 [test/sql/testing_sql_util.cpp:58:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM pg_catalog.pg_query_history; 13: 2018-04-18 14:27:24 [test/sql/testing_sql_util.cpp:93:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS 13: 2018-04-18 14:27:26 [test/sql/testing_sql_util.cpp:58:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM pg_catalog.pg_query_history; 13: 2018-04-18 14:27:26 [test/sql/testing_sql_util.cpp:93:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS 13: 2018-04-18 14:27:28 [test/sql/testing_sql_util.cpp:58:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM pg_catalog.pg_query_history; 13: 2018-04-18 14:27:28 [test/sql/testing_sql_util.cpp:93:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS 13: 2018-04-18 14:27:30 [test/sql/testing_sql_util.cpp:58:ExecuteSQLQuery] INFO - Query: SELECT query_string, fingerprint FROM pg_catalog.pg_query_history; 13: 2018-04-18 14:27:30 [test/sql/testing_sql_util.cpp:93:ExecuteSQLQuery] INFO - Statement executed. Result: SUCCESS 13: [ OK ] QueryLoggerTests.QueriesTest (15801 ms) 13: [----------] 1 test from QueryLoggerTests (15801 ms total) 13: 13: [----------] Global test environment tear-down 13: [==========] 1 test from 1 test case ran. (15801 ms total) 13: [ PASSED ] 1 test. 13: 13: ================================================================= 13: ==26808==ERROR: LeakSanitizer: detected memory leaks 13: 13: Direct leak of 472 byte(s) in 1 object(s) allocated from: 13: #0 0x7f293fcd9532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532) 13: #1 0x7f293d80d599 in peloton::concurrency::TransactionManager::BeginTransaction(unsigned long, peloton::IsolationLevelType) /tmp/workspace/peloton_PR-1271-OTJTL66AGB2C26ZL6NIM4XVKJGQQTMZYVGTE2PEWOG5PXARBHSLQ/src/concurrency/transaction_manager.cpp:66 13: #2 0x7f293d7c7e45 in peloton::brain::QueryLogger::LogQuery(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, unsigned long) /tmp/workspace/peloton_PR-1271-OTJTL66AGB2C26ZL6NIM4XVKJGQQTMZYVGTE2PEWOG5PXARBHSLQ/src/brain/query_logger.cpp:37 13: #3 0x7f293de1088b in peloton::gc::TransactionLevelGCManager::Unlink(int const&, unsigned long const&)::{lambda()#2}::operator()() const (/tmp/workspace/peloton_PR-1271-OTJTL66AGB2C26ZL6NIM4XVKJGQQTMZYVGTE2PEWOG5PXARBHSLQ/build/lib/libpeloton-d.so.0.0.5+0x1d7488b) 13: #4 0x7f293de13457 in _M_invoke /usr/include/c++/5/functional:1871 13: #5 0x7f293d97c743 in std::function<void ()>::operator()() const /usr/include/c++/5/functional:2267 13: #6 0x7f293d97bd99 in peloton::threadpool::WorkerFunc(std::atomic, peloton::LockFreeQueue<std::function<void ()> >) /tmp/workspace/peloton_PR-1271-OTJTL66AGB2C26ZL6NIM4XVKJGQQTMZYVGTE2PEWOG5PXARBHSLQ/src/threadpool/worker_pool.cpp:30 13: #7 0x7f293d7ef113 in void std::_Bind_simple<void ((std::atomic, peloton::LockFreeQueue<std::function<void ()> >))(std::atomic, peloton::LockFreeQueue<std::function<void ()> >)>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) /usr/include/c++/5/functional:1531 13: #8 0x7f293d7eecbd in std::_Bind_simple<void ((std::atomic, peloton::LockFreeQueue<std::function<void ()> >))(std::atomic, peloton::LockFreeQueue<std::function<void ()> >)>::operator()() /usr/include/c++/5/functional:1520 13: #9 0x7f293d7ee7d3 in std::thread::_Impl<std::_Bind_simple<void ((std::atomic, peloton::LockFreeQueue<std::function<void ()> >))(std::atomic, peloton::LockFreeQueue<std::function<void ()> >*)> >::_M_run() /usr/include/c++/5/thread:115 13: #10 0x7f293b323c7f (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xb8c7f)