[BUG] bplus_tree_log_test failed occasionally.
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 4.4k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
A clear and concise description of what the bug is.
[BUG] bplus_tree_log_test failed occasionally.
in build debug mode,
/home/runner/work/miniob-private/miniob-private/unittest/observer/bplus_tree_log_test.cpp:294: Failure
27: Expected equality of these values:
27: rids1.size()
27: Which is: 1393
27: rids2.size()
27: Which is: 1392
27: =================================================================
27: ==11827==ERROR: AddressSanitizer: heap-use-after-free on address 0x512000000dc0 at pc 0x55e1a9590e56 bp 0x7fff8ffbe2e0 sp 0x7fff8ffbe2d0
27: READ of size 8 at 0x512000000dc0 thread T0
27: #0 0x55e1a9590e55 in BufferPoolLogHandler::flush_page(Page&) /home/runner/work/miniob-private/miniob-private/src/observer/storage/buffer/buffer_pool_log.cpp:45
27: #1 0x55e1a95b4d1a in DiskBufferPool::flush_page_internal(Frame&) /home/runner/work/miniob-private/miniob-private/src/observer/storage/buffer/disk_buffer_pool.cpp:550
27: #2 0x55e1a95b028b in DiskBufferPool::purge_frame(int, Frame*) /home/runner/work/miniob-private/miniob-private/src/observer/storage/buffer/disk_buffer_pool.cpp:483
27: #3 0x55e1a95b2118 in DiskBufferPool::purge_all_pages() /home/runner/work/miniob-private/miniob-private/src/observer/storage/buffer/disk_buffer_pool.cpp:515
27: #4 0x55e1a95a3736 in DiskBufferPool::close_file() /home/runner/work/miniob-private/miniob-private/src/observer/storage/buffer/disk_buffer_pool.cpp:289
27: #5 0x55e1a959e47b in DiskBufferPool::~DiskBufferPool() /home/runner/work/miniob-private/miniob-private/src/observer/storage/buffer/disk_buffer_pool.cpp:225
27: #6 0x55e1a95c5d7f in BufferPoolManager::~BufferPoolManager() /home/runner/work/miniob-private/miniob-private/src/observer/storage/buffer/disk_buffer_pool.cpp:785
27: #7 0x55e1a953ed81 in std::default_delete<BufferPoolManager>::operator()(BufferPoolManager*) const /usr/include/c++/13/bits/unique_ptr.h:99
27: #8 0x55e1a953680d in std::unique_ptr<BufferPoolManager, std::default_delete<BufferPoolManager> >::~unique_ptr() /usr/include/c++/13/bits/unique_ptr.h:404
27: #9 0x55e1a9527a5f in BplusTreeLog_concurrency_Test::TestBody() /home/runner/work/miniob-private/miniob-private/unittest/observer/bplus_tree_log_test.cpp:317
27: #10 0x55e1a9920b1c in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (/home/runner/work/miniob-private/miniob-private/build_debug/bin/bplus_tree_log_test+0x9d2b1c) (BuildId: 6c494f5ef02ffe11fdc839281dd94ff03182992e)
27: #11 0x55e1a99193f6 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (/home/runner/work/miniob-private/miniob-private/build_debug/bin/bplus_tree_log_test+0x9cb3f6) (BuildId: 6c494f5ef02ffe11fdc839281dd94ff03182992e)
27: #12 0x55e1a98f3515 in testing::Test::Run() (/home/runner/work/miniob-private/miniob-private/build_debug/bin/bplus_tree_log_test+0x9a5515) (BuildId: 6c494f5ef02ffe11fdc839281dd94ff03182992e)
27: #13 0x55e1a98f40e6 in testing::TestInfo::Run() (/home/runner/work/miniob-private/miniob-private/build_debug/bin/bplus_tree_log_test+0x9a60e6) (BuildId: 6c494f5ef02ffe11fdc839281dd94ff03182992e)
27: #14 0x55e1a98f4a88 in testing::TestSuite::Run() (/home/runner/work/miniob-private/miniob-private/build_debug/bin/bplus_tree_log_test+0x9a6a88) (BuildId: 6c494f5ef02ffe11fdc839281dd94ff03182992e)
27: #15 0x55e1a9905b15 in testing::internal::UnitTestImpl::RunAllTests() (/home/runner/work/miniob-private/miniob-private/build_debug/bin/bplus_tree_log_test+0x9b7b15) (BuildId: 6c494f5ef02ffe11fdc839281dd94ff03182992e)
27: #16 0x55e1a9921ce6 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (/home/runner/work/miniob-private/miniob-private/build_debug/bin/bplus_tree_log_test+0x9d3ce6) (BuildId: 6c494f5ef02ffe11fdc839281dd94ff03182992e)
27: #17 0x55e1a991a722 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (/home/runner/work/miniob-private/miniob-private/build_debug/bin/bplus_tree_log_test+0x9cc722) (BuildId: 6c494f5ef02ffe11fdc839281dd94ff03182992e)
27: #18 0x55e1a9903f94 in testing::UnitTest::Run() (/home/runner/work/miniob-private/miniob-private/build_debug/bin/bplus_tree_log_test+0x9b5f94) (BuildId: 6c494f5ef02ffe11fdc839281dd94ff03182992e)
27: #19 0x55e1a95307ad in RUN_ALL_TESTS() (/home/runner/work/miniob-private/miniob-private/build_debug/bin/bplus_tree_log_test+0x5e27ad) (BuildId: 6c494f5ef02ffe11fdc839281dd94ff03182992e)
27: #20 0x55e1a952bc01 in main /home/runner/work/miniob-private/miniob-private/unittest/observer/bplus_tree_log_test.cpp:325
27: #21 0x7f967de2a1c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 42c84c92e6f98126b3e2230ebfdead22c235b667)
27: #22 0x7f967de2a28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 42c84c92e6f98126b3e2230ebfdead22c235b667)
27: #23 0x55e1a950df54 in _start (/home/runner/work/miniob-private/miniob-private/build_debug/bin/bplus_tree_log_test+0x5bff54) (BuildId: 6c494f5ef02ffe11fdc839281dd94ff03182992e)
** Environment**
Environment Details sometimes important
- OS Version:
- CPU Arch(x86/arm):
- Compiler:
- Others:
Fast Reproduce Steps(Required)
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Actual Behavior
What is the result? picture is allowed
Additional context
Add any other context about the problem here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with unittest/observer/bplus_tree_log_test.cpp, especially the concurrency test around lines 294–325, and reproduce it in the debug build. Trace the reported cleanup path through src/observer/storage/buffer/buffer_pool_log.cpp:45 and disk_buffer_pool.cpp lines 225, 289, 483, 515, 550, and 785. Done means the test no longer intermittently disagrees on RID counts or reports the shown AddressSanitizer use-after-free.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- databases, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100