Skip to content

[Bug]: test_main segfault #2989

@yuzhichang

Description

@yuzhichang

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Version or Commit ID

7316618

Other environment information

Actual behavior and How to reproduce it

I debug test_main inside VSCode and got segfault:

[10:36:19.451] [765003] [trace] WalManager::Flush done writing wal for txn_id 42, commit_ts 32
[10:36:19.451] [765003] [trace] WAL flush is finished.
[10:36:19.452] [765004] [trace] Transaction commit bottom: 42 start.
[10:36:19.452] [765004] [trace] Transaction 42 notify top half, commit ts 32.
[10:36:19.452] [765013] [debug] Cleanup txn, id: 42, begin_ts: 25
[10:36:19.453] [765013] [debug] Checkpoint in background done
    #0 0x7ffff7ca1b9d in __pthread_rwlock_rdlock@GLIBC_2.2.5 (/lib64/libc.so.6+0xa1b9d) (BuildId: c2df7a1e82bbffe5ecf1c4ef204438764d22d728)
    #1 0x55555a206a4c in std::__glibcxx_rwlock_rdlock(pthread_rwlock_t*) /usr/lib/gcc/x86_64-pc-linux-gnu/15.2.0/../../../../include/c++/15.2.0/shared_mutex:85:3
    #2 0x55555a2069bc in std::__shared_mutex_pthread::lock_shared() /usr/lib/gcc/x86_64-pc-linux-gnu/15.2.0/../../../../include/c++/15.2.0/shared_mutex:236:10
    #3 0x55555a206994 in std::shared_mutex::lock_shared() /usr/lib/gcc/x86_64-pc-linux-gnu/15.2.0/../../../../include/c++/15.2.0/shared_mutex:433:34
    #4 0x55555a1f27e3 in std::shared_lock<std::shared_mutex>::shared_lock(std::shared_mutex&) /usr/lib/gcc/x86_64-pc-linux-gnu/15.2.0/../../../../include/c++/15.2.0/shared_mutex:745:13
    #5 0x55555e0e52f1 in infinity::NewTxn@infinity_core::GetTxnType() const /home/zhichyu/github.com/infiniflow/infinity/src/storage/new_txn/new_txn_impl.cpp:1856:41
    #6 0x55555e0e59c1 in infinity::NewTxn@infinity_core::Checkpoint(unsigned long, bool) /home/zhichyu/github.com/infiniflow/infinity/src/storage/new_txn/new_txn_impl.cpp:1722:32
    #7 0x55555ae5bc42 in TestTxnCleanupInternal_test_cleanup_drop_index_and_checkpoint_and_restart_Test@infinity_core::TestBody() /home/zhichyu/github.com/infiniflow/infinity/src/unit_test/storage/new_catalog/cleanup_internal_ut.cpp:1021:30
    #8 0x555560be0c73 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /opt/vcpkg/buildtrees/gtest/src/v1.17.0-0c449efaff.clean/googletest/src/gtest.cc:2664:10
    #9 0x555560bce1b5 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /opt/vcpkg/buildtrees/gtest/src/v1.17.0-0c449efaff.clean/googletest/src/gtest.cc:2700:14
    #10 0x555560babf46 in testing::Test::Run() /opt/vcpkg/buildtrees/gtest/src/v1.17.0-0c449efaff.clean/googletest/src/gtest.cc:2739:5
    #11 0x555560bac9ce in testing::TestInfo::Run() /opt/vcpkg/buildtrees/gtest/src/v1.17.0-0c449efaff.clean/googletest/src/gtest.cc:2885:11
    #12 0x555560bad209 in testing::TestSuite::Run() /opt/vcpkg/buildtrees/gtest/src/v1.17.0-0c449efaff.clean/googletest/src/gtest.cc:3063:30
    #13 0x555560bbf553 in testing::internal::UnitTestImpl::RunAllTests() /opt/vcpkg/buildtrees/gtest/src/v1.17.0-0c449efaff.clean/googletest/src/gtest.cc:6054:44
    #14 0x555560be47e3 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /opt/vcpkg/buildtrees/gtest/src/v1.17.0-0c449efaff.clean/googletest/src/gtest.cc:2664:10
    #15 0x555560bd0485 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /opt/vcpkg/buildtrees/gtest/src/v1.17.0-0c449efaff.clean/googletest/src/gtest.cc:2700:14
    #16 0x555560bbee05 in testing::UnitTest::Run() /opt/vcpkg/buildtrees/gtest/src/v1.17.0-0c449efaff.clean/googletest/src/gtest.cc:5594:10
    #17 0x5555598d79a0 in RUN_ALL_TESTS() /home/zhichyu/github.com/infiniflow/infinity/cmake-build-debug/vcpkg_installed/x64-linux/include/gtest/gtest.h:2334:73
    #18 0x5555598d793e in main /home/zhichyu/github.com/infiniflow/infinity/src/unit_test/main.cpp:19:12
    #19 0x7ffff7c2b2fa in __libc_start_call_main (/lib64/libc.so.6+0x2b2fa) (BuildId: c2df7a1e82bbffe5ecf1c4ef204438764d22d728)
    #20 0x7ffff7c2b3ca in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2b3ca) (BuildId: c2df7a1e82bbffe5ecf1c4ef204438764d22d728)
    #21 0x5555597f12ad in _start (/home/zhichyu/github.com/infiniflow/infinity/cmake-build-debug/src/test_main+0x429d2ad) (BuildId: c2b0e6e570bf6b40f074a63e4e9a9c1421e94337)

==764872==Register values:
rax = 0x0000000000000001  rbx = 0x0000000000000078  rcx = 0x0000000000000078  rdx = 0x000000008fff6fff  
rdi = 0x0000000000000078  rsi = 0x0000000000000078  rbp = 0x00007fffffffaea0  rsp = 0x00007fffffffae70  
 r8 = 0x0000000000000000   r9 = 0x00007fffffffff01  r10 = 0x0000000000000001  r11 = 0x000000000000002d  
r12 = 0xf2f8f8f2f2f200f2  r13 = 0xf8f2f2f8f8f2f2f2  r14 = 0xf8f2f2f2f8f2f2f2  r15 = 0xf8f2f8f2f2f8f8f2  
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib64/libc.so.6+0xa1b9d) (BuildId: c2df7a1e82bbffe5ecf1c4ef204438764d22d728) in __pthread_rwlock_rdlock@GLIBC_2.2.5
==764872==ABORTING
You have new mail in /var/mail/zhichyu
(venv310) zhichyu@iris:~/github.com/infiniflow/infinity> 

Expected behavior

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions