Fix std::terminate in ibverbs destructors on systems without RDMA hardware#500
Merged
meta-codesync[bot] merged 1 commit intomainfrom Mar 20, 2026
Merged
Fix std::terminate in ibverbs destructors on systems without RDMA hardware#500meta-codesync[bot] merged 1 commit intomainfrom
meta-codesync[bot] merged 1 commit intomainfrom
Conversation
7de27ba to
7b0254f
Compare
…vice On CI runners without real RDMA hardware, rdma-core software providers let ibv_open_device/ibv_alloc_pd/ibv_create_comp_channel succeed but ibv_create_qp fails with EINVAL. Creating a gloo Device starts a background thread; after fork() in TransportMultiProcTest the thread handle is invalid, causing SIGSEGV (exit 139) in Device::~Device. Fix: probe ibverbs capability using raw APIs (through ibv_create_qp) in the test's createDevice() before constructing a gloo Device. If QP creation fails, mark IBVERBS as unavailable and return nullptr. Also moves GTEST_SKIP() out of worker threads to avoid concurrent calls racing on GTest internals (exit 134), adds a SIGSEGV backtrace handler for test debugging, and builds with RelWithDebInfo.
dolpm
approved these changes
Mar 20, 2026
kapilsh
approved these changes
Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-DUSE_IBVERBS=ON), rdma-core userspace providers makeibv_get_device_list()return devices even without real RDMA hardware. The ibverbsDeviceconstructor succeeds, butibv_create_qp()fails in thePairconstructor, throwingEnforceNotMet. During stack unwinding,~Pair()and~Device()callGLOO_ENFORCEwhich throws from implicitlynoexceptdestructors (C++11+), causingstd::terminate().Fixes the crash at
AllgatherRing/AllgatherTest.VarNumPointer/360seen in every CI run: https://github.com/pytorch/gloo/actions/runs/22975489184/job/66702898253See also #497 which identified the same crash but addressed it differently.
Test plan
-DUSE_IBVERBS=ON -DUSE_LIBUV=ON -DUSE_TCP_OPENSSL_LINK=ON