Repository: cmu-db/noisepage

Issue #544: TPCC test: bwtree memory leak
Created: 2019-09-16T16:37:17Z
I spent some time chasing the infrequent tpcc_test failures on Jenkins. Looks like we still have a memory leak in the bwtree. I had to bump scale factor to 8 and increase number of transactions per worker to 100,000 on dev4. Log attached.
tpcc_asan.txt

Duplicate issue #791: Bw-Tree: Heap-Use-After-Free Error
Created: 2020-02-24T13:55:42Z
This error showed up after running the TPC-C tests for several hours. I locally modified ADD_TERRIER_TESTS in BuildUtils.cmake to only select tpcc_test.cpp. This makes it so that when you invoke make unittest it only runs the TPC-C tests instead of the full suite.
$ cmake -DCMAKE_BUILD_TYPE=relwithdebinfo -DTERRIER_BUILD_BENCHMARKS=OFF -DTERRIER_USE_ASAN=yes ..
$ cnt=0 ; while [ true ]; do echo $cnt ; make -j 2 unittest ; test $? -ne 0 && break; cnt=$((cnt + 1)) ; done ; echo $cnt
<SNIP>
Test project /home/pavlo/Documents/Peloton/Github/terrier/build                             
    Start 1: tpcc_test                          
1/1 Test #1: tpcc_test ........................***Failed   66.35 sec                        
                              
0% tests passed, 1 tests failed out of 1                                                            
                                                                                                     
Label Time Summary:                                                                                   
unittest    =  66.35 sec*proc (1 test)                         
                                                                                                       
Total Test time (real) =  66.35 sec
                                                                                                       
The following tests FAILED:                                     
          1 - tpcc_test (Failed)                                                                       

Full error output is attached.
==11056==ERROR: AddressSanitizer: heap-use-after-free on address 0x60302196d480 at pc 0x56066f4f561c bp 0x7fbadc4f7970 sp 0x7fbadc4f7960
WRITE of size 4 at 0x60302196d480 thread T22
    #0 0x56066f4f561b in std::__atomic_base<int>::fetch_sub(int, std::memory_order) /usr/include/c++/7/bits/atomic_base.h:524
    #1 0x56066f4f561b in third_party::bwtree::BwTree<terrier::storage::index::CompactIntsKey<(unsigned char)16>, terrier::storage::TupleSlot, std::less<terrier::storage::index::CompactIntsKey<(unsigned char)16> >, std::equal_to<terrier::storage::index::CompactIntsKey<(unsigned char)16> >, std::hash<terrier::storage::index::CompactIntsKey<(unsigned char)16> >, std::equal_to<terrier::storage::TupleSlot>, std::hash<terrier::storage::TupleSlot> >::EpochManager::LeaveEpoch(third_party::bwtree::BwTree<terrier::storage::index::CompactIntsKey<(unsigned char)16>, terrier::storage::TupleSlot, std::less<terrier::storage::index::CompactIntsKey<(unsigned char)16> >, std::equal_to<terrier::storage::index::CompactIntsKey<(unsigned char)16> >, std::hash<terrier::storage::index::CompactIntsKey<(unsigned char)16> >, std::equal_to<terrier::storage::TupleSlot>, std::hash<terrier::storage::TupleSlot> >::EpochManager::EpochNode*) /home/pavlo/Documents/Peloton/Github/terrier/third_party/bwtree/bwtree.h:7238

Closing comment (2020-02-24T14:29:35Z): Dupe of #544? The ASAN trace actually looks different.