SIGSEGV in PartitionedLockHead on MongoDB 6.0 FreeBSD

Hi, I’m maintaining some MongoDB ports for FreeBSD.
MongoDB 6.0 compiles fine, but after startup it crashes on a segmentation fault.
The information is collected in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267668

I’ll quote the backtrace of 6.0.2 below. On 6.0.3 I get the same error.
I build mongodb statically (without system libs) also, but same issue.

Any help would be appreciated. Can I provide more information? Or help reproducing.


Thread 1 received signal SIGSEGV, Segmentation fault.
Address not mapped to object.
absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::NodeHashMapPolicy<mongo::ResourceId, mongo::PartitionedLockHead*>, absl::lts_20210324::hash_internal::Hash<mongo::ResourceId>, std::__1::equal_to<mongo::ResourceId>, std::__1::allocator<std::__1::pair<mongo::ResourceId const, mongo::PartitionedLockHead*> > >::find<mongo::ResourceId> (this=0x47dd6c90, key=..., hash=<optimized out>) at src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/raw_hash_set.h:1372
1372    src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/raw_hash_set.h: No such file or directory.
(gdb) bt
#0  absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::NodeHashMapPolicy<mongo::ResourceId, mongo::PartitionedLockHead*>, absl::lts_20210324::hash_internal::Hash<mongo::ResourceId>, std::__1::equal_to<mongo::ResourceId>, std::__1::allocator<std::__1::pair<mongo::ResourceId const, mongo::PartitionedLockHead*> > >::find<mongo::ResourceId> (
    this=0x47dd6c90, key=..., hash=<optimized out>)
    at src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/raw_hash_set.h:1372
#1  absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::NodeHashMapPolicy<mongo::ResourceId, mongo::PartitionedLockHead*>, absl::lts_20210324::hash_internal::Hash<mongo::ResourceId>, std::__1::equal_to<mongo::ResourceId>, std::__1::allocator<std::__1::pair<mongo::ResourceId const, mongo::PartitionedLockHead*> > >::find<mongo::ResourceId> (
    this=0x47dd6c90, key=...)
    at src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/raw_hash_set.h:1386
#2  mongo::LockHead::migratePartitionedLockHeads (
    this=this@entry=0x4865b300)
    at src/mongo/db/concurrency/lock_manager.cpp:390
#3  0x0000000004699794 in mongo::LockManager::lock (
    this=0x48722c60, resId=..., request=0x481126f0, 
    mode=<optimized out>)
    at src/mongo/db/concurrency/lock_manager.cpp:527
#4  0x00000000046a0140 in mongo::LockerImpl::_lockBegin (
    this=0x48016d00, opCtx=0x4864cc00, resId=..., 
    mode=1219626888)
    at src/mongo/db/concurrency/lock_state.cpp:910
#5  0x00000000046a22cc in mongo::LockerImpl::lock (
--Type <RET> for more, q to quit, c to continue without paging--    this=0x48016d00, opCtx=0x4864cc00, resId=..., 
    mode=mongo::MODE_X, deadline=...)
    at src/mongo/db/concurrency/lock_state.cpp:546
#6  0x00000000046978a8 in mongo::Lock::DBLock::DBLock (
    this=0xffffffffe860, opCtx=0x4864cc00, db=..., 
    mode=<optimized out>, deadline=..., 
    skipGlobalAndRSTLLocks=false)
    at src/mongo/db/concurrency/d_concurrency.cpp:226
#7  0x0000000003fe8964 in mongo::AutoGetDb::AutoGetDb (
    this=0xffffffffe848, opCtx=0x48b20788, dbName=..., 
    mode=mongo::MODE_X, deadline=..., secondaryDbNames=...)
    at src/mongo/db/catalog_raii.cpp:171
#8  0x0000000002c0d204 in mongo::(anonymous namespace)::logStartup (opCtx=0x4864cc00) at src/mongo/db/mongod_main.cpp:277
#9  mongo::(anonymous namespace)::_initAndListen (
    serviceContext=<optimized out>, listenPort=<optimized out>)
    at src/mongo/db/mongod_main.cpp:677
#10 0x0000000002c0b3fc in mongo::(anonymous namespace)::initAndListen (service=0x0, listenPort=<optimized out>)
    at src/mongo/db/mongod_main.cpp:850
#11 0x0000000002c06270 in mongo::mongod_main (argc=3, 
    argv=<optimized out>) at src/mongo/db/mongod_main.cpp:1548
#12 0x0000000002c05bc4 in main (argc=0, argv=0x48b20788)
    at src/mongo/db/mongod.cpp:47
(gdb)
1 Like

Hi Ronald, I’m using your mongodb60 port (6.0.2). Most likely you’re aware of this already, but just in case:

I was getting the segmentation faults on startup on a fresh FreeBSD 13.1 machine (VMware ESXi VM) with 1GB of RAM. After upgrading the VM to 2GB the mongod daemon starts without issues.

Hi, thanks for your remark. How is it going so far? My experience is that the first init of the DB fails. Sometimes a restart succeeds but mostly it does not. So to me it looks a bit like a race condition. What is your experience? Did it stay stable?

This issue is solved in https://jira.mongodb.org/browse/SERVER-71608 and the fix is applied to the current port in FreeBSD.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.