Skip to content

PERF/UCT: Preserve address lengths in reachability checks - #12215

Closed
shasson5 wants to merge 5 commits into
openucx:masterfrom
shasson5:cuda-loopback-reachability
Closed

shasson5 wants to merge 5 commits into
openucx:masterfrom
shasson5:cuda-loopback-reachability

Conversation

@shasson5

@shasson5 shasson5 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #12311 as part of the combined Blossom fixes.

What?

Pass exchanged device and interface address lengths to UCT reachability checks in libperf, and permit same-process CUDA IPC for CUDA loopback cases.

Why?

The legacy reachability helper omits address lengths needed by CUDA IPC, which can incorrectly report the destination as unreachable during endpoint setup.

HPCINFRA-5030

@shasson5
shasson5 requested a review from a team as a code owner November 2, 2026 17:33
@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

@svc-ucx

svc-ucx commented Nov 3, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (Tests new on worker 1) · commit a0fc3bd8

TL;DR: The gtest job failed on exactly one case — tcp/test_ucp_rma.put_nonblocking/0 <tcp,cuda_copy,rocm_copy/flush_worker> — in the code path this PR touches (UCT reachability); PR #12215 adds device_addr_length/iface_addr_length to uct_iface_is_reachable_params_t and populates them from the remote packed address, but the common helper uct_iface_scope_is_reachable() → uct_iface_is_same_device() still compares using the local iface_attr.device_addr_len, so remote addresses of a different length (TCP loopback vs. non-loopback, legacy vs. extended cuda_ipc) are compared/over-read with the wrong size and reachability can flip.

Full analysis

Summary: make test in the "Tests new on worker 1" job exited with code 2 after [ FAILED ] tcp/test_ucp_rma.put_nonblocking/0, where GetParam() = tcp,cuda_copy,rocm_copy/flush_worker (8854/8855 tests passed).

Root cause: Evidence from the log: a single, deterministic functional failure in a TCP+cuda_copy RMA test, i.e. in the lane-selection/reachability area this PR modifies (the per-test assertion text itself is before the 500-line tail that the Azure log API returns, so only the failure identity is visible).

From the source on this branch, the PR is incomplete in a way that matches that failure:

  • src/ucp/wireup/wireup.c:2015-2024 now always sets UCT_IFACE_IS_REACHABLE_FIELD_DEVICE_ADDR_LENGTH|IFACE_ADDR_LENGTH with ae->dev_addr_len / ae->iface_addr_len. Those come from the packed address and can legitimately be 0/NULL (src/ucp/wireup/address.c:443-447, 1795-1796 when UCP_ADDRESS_PACK_FLAG_DEVICE_ADDR is not set).
  • src/uct/base/uct_iface.c:303-322 (uct_iface_scope_is_reachable) and :230-251 (uct_iface_is_same_device) ignore the new params->device_addr_length and memcmp() attr.device_addr_len bytes of the local iface against the remote buffer. For TCP the device-address length differs between loopback and non-loopback ifaces (uct_tcp_iface_get_device_address_length(), src/uct/tcp/tcp_iface.c:161-178: sizeof(uct_tcp_device_addr_t)+sizeof(uct_iface_local_addr_ns_t) vs. +in_addr_len), so the device-scope check both over-reads and compares the wrong byte count → wrong reachable/unreachable verdict for some tcp device pairs (the job's workers use 127.0.0.1, 1.1.159.x and 10.224.36.118).
  • src/uct/tcp/tcp_iface.c:200-250 also never consults the new length fields, while src/uct/cuda/cuda_ipc/cuda_ipc_iface.c:149-226 does — an inconsistency that makes reachability depend on which transport is asked.

Implicated commit: [REDACTED:Hex High Entropy String] (PR #12215, branch cuda-loopback-reachability) — author not exposed by the available tooling.

File: src/uct/base/uct_iface.c:230-251 and :303-322 (plus src/ucp/wireup/wireup.c:2015-2024, src/uct/tcp/tcp_iface.c:200-250)

Suggested fix:

  1. Make uct_iface_is_same_device() / uct_iface_scope_is_reachable() honor the new field: take len = UCS_PARAM_VALUE(UCT_IFACE_IS_REACHABLE_FIELD, params, device_addr_length, DEVICE_ADDR_LENGTH, attr.device_addr_len), bail out as "unreachable" (with an info string) when len < attr.device_addr_len instead of memcmp-ing past the remote buffer.
  2. In ucp_wireup_is_reachable(), do not advertise DEVICE_ADDR/DEVICE_ADDR_LENGTH (or IFACE_ADDR*) when ae->dev_addr == NULL / ae->dev_addr_len == 0, mirroring ucp_wireup_fill_is_connected_params() (wireup.c:2838-2852).
  3. Have uct_tcp_iface_is_reachable_v2() validate params->device_addr_length before casting/dereferencing uct_tcp_device_addr_t and before reading the trailing uct_iface_local_addr_ns_t in the loopback branch.
  4. For triage: re-post the failing build's full test_jenkins.sh log (or the gtest XML) so the exact assertion line of test_ucp_rma.put_nonblocking is visible; the Azure API tail only retains the final summary.

Related: PR #12215 (this change), PR #11783 "UCT/CUDA_COPY: Fix reachability between interfaces", commit f9cd4140 "UCT/TCP: Fix loopback reachability check (#11202)", commit c2855a44 "UCT: Shorter info about unreachable address (#11228)"

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id bc65f773-0f1e-4f2c-8de4-5f6a57831e76 in the triage console for the audit trail.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

reachable_params.iface_addr =
remote_info->uct.iface_addr_len ? iface_addr : NULL;
reachable_params.iface_addr_length = remote_info->uct.iface_addr_len;
if (!uct_iface_is_reachable_v2(perf->uct.iface, &reachable_params)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also set UCT_IFACE_IS_REACHABLE_FIELD_INFO_STRING/_LENGTH and print the buffer in the error below? the v2 API reports the reason (e.g. "same process", "different NVLink domain"), which is much easier to debug than "Destination is unreachable".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread src/uct/ugni/base/ugni_iface.c Outdated
(uct_ep_invalidate_func_t)ucs_empty_function_return_unsupported,
.ep_connect_to_ep_v2 =
(uct_ep_connect_to_ep_v2_func_t)ucs_empty_function_return_unsupported,
.iface_is_reachable_v2 = uct_ugni_iface_is_reachable_v2,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugni_rdma and ugni_udt still set .iface_is_reachable = uct_ugni_iface_is_reachable, which returns 1 unconditionally, so the v1 and v2 paths now give different answers. maybe switch them to uct_base_iface_is_reachable like ugni_smsg and drop uct_ugni_iface_is_reachable?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not retained: uGNI changes have been reverted as independent of this PR's libperf/CUDA loopback fix. The transport now matches the PR base.

protected:
void init() override
{
ucs::test_base::modify_config("CUDA_IPC_ENABLE_SAME_PROCESS", "y",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: pls add a short comment why the base-class version is used here; uct_test::modify_config would only update the test's own iface config and would not export UCX_CUDA_IPC_ENABLE_SAME_PROCESS, which is needed because the perf tool opens its own iface.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage note: ugni_rdma/ugni_udt cannot be built or run in CI, so the NULL-internal_ops fix is compile-checked only.

Residual coverage note: test_uct_loopback_cuda only exercises cuda_ipc loopback when a GPU with cuda_ipc is present; note that test_execute() does not disable check_perf for cuda_ipc (unlike cuda_copy/gdr_copy), so the host-calibrated latency/bandwidth bounds now apply to any run where this pair newly becomes reachable. Worth watching the first CI runs for flakiness.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread src/uct/ugni/base/ugni_iface.c Outdated

ucs_assert(params->open_mode & UCT_IFACE_OPEN_MODE_DEVICE);

if (internal_ops == NULL) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not pass &uct_ugni_iface_internal_ops explicitly from ugni_rdma/ugni_udt like ugni_smsg does? no other base iface in UCT defaults internal_ops on NULL, so an implicit default here is easy to miss for a future ugni iface.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not retained: the underlying uGNI internal-ops defect predates this PR. Its fix has been removed from this PR and should be handled separately.

Comment thread test/gtest/uct/test_uct_perf.cc Outdated
protected:
void init() override
{
/* Export config for the separate iface opened by libperf. */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: pls note in the comment that uct_test::modify_config() cannot be used here, since it would only update the test's own iface config and skip the env export - otherwise this is easy to "simplify" and the cuda_ipc loopback silently goes back to being skipped as unreachable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage gap (same as noted before, not re-raised inline): the ugni path is compile-only in CI, and the cuda_ipc loopback pair only runs on a GPU machine with cuda_ipc present.

@svc-ucx

svc-ucx commented Nov 9, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (AddressSanitizer BlueField on worker 0) · commit f0ce7005

TL;DR: The ASAN BlueField job wasn't slow — it hung: rc_mlx5/test_rc.sgl_pending_am_order/1 started at 23:07:17 and produced no output for 14m36s until the Azure agent was torn down, so the kill/cancel is a symptom of a deadlock in the RC multi-credit SGL pending path (sticky per-EP txqp_reserve/cq_reserve), not a time-limit problem.

Full analysis

Summary: Job "AddressSanitizer BlueField on worker 0" (build 144028) was cancelled while rc_mlx5/test_rc.sgl_pending_am_order/1 <rc_mlx5/mlx5_1:1> was running; the gtest process had to be killed as an orphan.

Root cause: Timestamp analysis of the fetched Azure log shows continuous per-test output at sub-second granularity (every test before it finished in 1–5000 ms), then:

  • 23:07:17.2283786Z [ RUN ] rc_mlx5/test_rc.sgl_pending_am_order/1 <rc_mlx5/mlx5_1:1>
  • …14 minutes 36 seconds of complete silence…
  • 23:21:53.4875244Z ##[error]The agent has received a shutdown signal
  • Terminate orphan process: pid (2894362) (gtest)

That single gap is the largest in the log and accounts for essentially all remaining runtime, so the process was hung inside that test, not making slow progress. The test never completed and no gtest watchdog/timeout message was emitted.

The hang is in the RC multi-credit SGL + pending-AM ordering path. uct_rc_mlx5_base_ep_sgl_zcopy_check() records sticky high-water-mark reservations when an SGL send fails for lack of credits:

UCT_RC_CHECK_CQE_VALUE_RET(&iface->super, &ep->super, UCS_ERR_NO_RESOURCE, count - 1);
UCT_RC_CHECK_NUM_RDMA_READ_RET(&iface->super, UCS_ERR_NO_RESOURCE);
UCT_RC_CHECK_TXQP_VALUE_RET(&iface->super, &ep->super, UCS_ERR_NO_RESOURCE, count - 1);

(src/uct/ib/mlx5/rc/rc_mlx5.inl:56-60; the macros do ep->txqp_reserve = ucs_max(ep->txqp_reserve, value) / ep->cq_reserve = ucs_max(...) in src/uct/ib/rc/base/rc_ep.h:104-123).

Those reserves are cleared in exactly one place — uct_rc_ep_process_pending() when a pending callback returns UCS_OK (src/uct/ib/rc/base/rc_ep.c:427-430). Until then uct_rc_ep_has_tx_resources() requires available > txqp_reserve and uct_rc_ep_have_tx_cqe_avail() requires cq_available > cq_reserve. Consequently:

  • uct_rc_ep_pending_add() (rc_ep.c:408-411) will not schedule the arbiter group while the stale reserve is in effect, and
  • uct_rc_ep_process_pending() returns DESCHED_GROUP/STOP for the same reason (rc_ep.c:433-448).

The group is then only re-armed by a TX CQE (ucs_arbiter_group_schedule() in uct_rc_mlx5_iface_poll_tx, rc_mlx5.inl:2112). Once the SGL ops have drained there are no more CQEs, so the pending AM short is never dispatched, the test's "wait until AM arrives in order" loop spins forever, and the worker wall-clock expires. ASAN + the slow BlueField ARM cores widen the window that makes this reproduce here.

Implicated commit: 51224230 — "UCT/IB/MLX5/RC: Implement get_sgl_zcopy (#11763)", Michal Shalev (the most recent change touching both rc_mlx5.inl's sgl_zcopy_check reservation path and rc_ep.h/rc_ep.c; the reservation mechanism itself came from 52907126 "UCT/RC: Add per-EP txqp_reserve for resource checks (#11361)", same author). The PR under test (#12215, cuda-loopback-reachability) does not touch RC/mlx5 and is almost certainly an innocent victim.

File: src/uct/ib/mlx5/rc/rc_mlx5.inl:56 (reservation set) and src/uct/ib/rc/base/rc_ep.c:428 (only reset site); check macros at src/uct/ib/rc/base/rc_ep.h:104-123.

Suggested fix:

  1. Make the reservation non-sticky: clear ep->txqp_reserve / ep->cq_reserve whenever a send on that EP succeeds (e.g. in uct_rc_txqp_posted()), and/or when the EP's arbiter group becomes empty — not only on a successful pending dispatch in uct_rc_ep_process_pending().
  2. Alternatively/additionally, in uct_rc_ep_pending_add() schedule the arbiter group unconditionally (or re-arm it from uct_rc_mlx5_iface_update_tx_cq_res()), so a 1-credit pending AM can be retried even while a stale multi-credit reservation is outstanding.
  3. Harden the test: bound the wait loop in sgl_pending_am_order with ucs::get_deadline() (as test_rc_get_limit.get_sgl_no_comp and test_rc_srq::test_reorder already do) so a resource deadlock fails the test with a diagnostic instead of hanging the CI agent.
  4. Re-run this PR's pipeline to confirm the failure is unrelated to PERF/UCT: Preserve address lengths in reachability checks #12215.

Related: #11841 (UCT/RC: Reserve TX credits for multi-credit sends — the only issue/PR matching sgl_pending_am_order), #11361 (per-EP txqp_reserve), #11763 / #11677 (get/put sgl_zcopy implementations).

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Review complete — no issues found.

@svc-ucx

svc-ucx commented Nov 10, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (AddressSanitizer gpu on worker 0) · commit b8cc477b

TL;DR: The build never got past the "Get sources" step — git fetch failed 15 times with fatal: could not read Username for 'https://github.com': terminal prompts disabled, i.e. the GitHub credential was not injected into the checkout task. This is a CI infrastructure/auth problem, not a code or test failure in PR #12215.

Full analysis

Summary: Job "gpu on worker 0" (AddressSanitizer, centos8-mofed23-cuda11_asan container) failed in the Checkout openucx/ucx@refs/pull/12215/merge to s step; no compilation or test ever ran.

Root cause: The checkout task ran without a usable GitHub credential. In the log, every credential probe comes back empty:

  • git config --get-all http.https://github.com/openucx/ucx.extraheader → no output
  • git config --get-all http.extraheader → no output
  • git config --get-regexp .*extraheader → no output

Then git --config-env=http.extraheader=env_var_http.extraheader fetch ... +[REDACTED:Hex High Entropy String]:refs/remotes/origin/... fails with fatal: could not read Username for 'https://github.com': terminal prompts disabled (exit 128) on all 3 inner retries × 5 outer RetryHelper attempts (13:49:02 → 13:51:00). Because the auth header is empty, git falls back to interactive prompting, which is disabled in CI, so it aborts immediately.

Note there is no hang here: the whole job is ~2 minutes of continuous activity, and the only gaps are the task's own exponential backoff sleeps (4.9s, 7.4s, 16s, 25s). Nothing was slow or timed out.

Secondary (cosmetic) noise in the log: git reset --hard HEAD → fatal: ambiguous argument 'HEAD' and the subsequent "delete source folder instead" warnings are just the retry logic cleaning an empty repo created by the previous failed attempt.

Implicated commit: unknown — the failure is independent of commit [REDACTED:Hex High Entropy String]; the repository contents were never fetched, so no PR code was exercised.

File: unknown (no source file involved; failure is in the Azure Pipelines Get sources task, before .azure/azure-pipelines*.yml build steps execute)

Suggested fix:

  1. Re-run the job — transient GitHub service-connection failures of this kind usually clear on retry.
  2. If it reproduces, the GitHub service connection for openucx/ucx in the ucfconsort ADO project is almost certainly broken: the PAT/OAuth token backing it has expired, been revoked, or lost repo read scope. Rotate/re-authorize that service connection (and rotate the old credential rather than reusing it).
  3. Verify the pipeline's checkout step does not set persistCredentials: false combined with a manual fetch, and that the job/agent is not stripping System.AccessToken or the http.extraheader env var — the empty git config --get-regexp .*extraheader output is the direct evidence that the header was never written.
  4. Agent-specific angle: this ran on swx-rdmz-ucx-gpu-01-04 (agent-04, workspace /scrap/azure/agent-04). If other workers checked out the same PR successfully, suspect this agent's config/credential store specifically and compare against a healthy worker.

Related: none — the issue search for this error signature returned no matching reports; prior PRs in the results are unrelated.

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id 0fff4a97-a1b1-42a9-a251-9a68c5da6894 in the triage console for the audit trail.

Restore uGNI to the PR base. Its internal operations and legacy reachability behavior are independent of the libperf address-length and CUDA loopback fix.
@shasson5

Copy link
Copy Markdown
Contributor Author

In response to this coverage note and its follow-up:

The uGNI changes have been reverted, so uGNI coverage is outside this PR. CUDA IPC loopback still requires a GPU with CUDA IPC support; the existing performance assertions are unchanged. Runtime validation of the new revision is pending.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

@svc-nvidia-pr-review

Copy link
Copy Markdown

ugni_rdma and ugni_udt still pass NULL as internal_ops to UCS_CLASS_CALL_SUPER_INIT(uct_ugni_iface_t, ...) (ugni_rdma_iface.c:280, ugni_udt_iface.c:398), and they are the only TLs that override ops.iface_is_reachable with a v1-only implementation. uct_iface_is_reachable_v2() dereferences iface->internal_ops unconditionally, so ucx_perftest -x ugni_rdma|ugni_udt would now take a NULL-function-pointer path that the old uct_iface_is_reachable() call avoided. The current diff no longer contains any src/uct/ugni change — please confirm the drop was intentional (e.g. split into another PR) rather than a rebase loss. Note these transports already fail the ucs_assert(internal_ops->...) checks in uct_base_iface_t init on debug builds, so they are partly broken independently of this change.

Coverage gap unchanged: the cuda_ipc loopback pair only executes on a GPU host with cuda_ipc present, and test_execute() still leaves check_perf enabled for cuda_ipc (unlike cuda_copy/gdr_copy), so the newly reachable pair is measured against host-calibrated latency/bandwidth bounds. Watch the first GPU CI runs for flakiness.

@shasson5
shasson5 requested a review from gleon99 November 10, 2026 19:28
@svc-ucx

svc-ucx commented Nov 10, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (Coverity coverity devel on coverity_rh7) · commit 923b2d83

TL;DR: The Coverity gate failed with one new FORWARD_NULL defect: uct_perf_test_setup_endpoints() now passes reachable_params.iface_addr = NULL when the peer reports iface_addr_len == 0, while still keeping UCT_IFACE_IS_REACHABLE_FIELD_IFACE_ADDR in the field mask, and uct_cuda_ipc_iface_is_reachable_v2() dereferences that pointer unconditionally. Fix by either dropping the IFACE_ADDR field bits instead of passing NULL, or hardening the cuda_ipc address unpack against a NULL/zero-length iface address.

Full analysis

Summary: Azure job "Coverity coverity devel on coverity_rh7" (build 144368) — build and analysis succeeded, but the pipeline failed on ##[error]Coverity found 1 issues: → src/tools/perf/lib/libperf.c:843: Explicit null dereferenced (FORWARD_NULL).

Root cause: In uct_perf_test_setup_endpoints() the reachability params are declared with UCT_IFACE_IS_REACHABLE_FIELD_IFACE_ADDR permanently set in field_mask (libperf.c:671-678), but the PR's new code sets the pointer conditionally:
reachable_params.iface_addr = remote_info->uct.iface_addr_len ? iface_addr : NULL; (libperf.c:820-821, line 840 in the PR snapshot).
Coverity's path 46-48 takes the iface_addr_len == 0 branch (true for CONNECT_TO_EP transports), so iface_addr is NULL. uct_iface_is_reachable_params_addrs_valid() only verifies that the field-mask bits are present (src/uct/base/uct_iface.c:295-301) — it does not check the pointer — so the NULL flows into the transport callback. The resolved callback uct_cuda_ipc_iface_is_reachable_v2() (src/uct/cuda/cuda_ipc/cuda_ipc_iface.c:175) calls uct_cuda_ipc_iface_address_unpack(params->iface_addr, ...), which dereferences it directly in uct_cuda_ipc_iface_address_unpack_pid(): return *(const pid_t*)iface_addr; (src/uct/cuda/cuda_ipc/cuda_ipc_iface_address.c:20). Note that iface_addr_len is not consulted for the pid field at all, only for pid_ns.

Implicated commit: [REDACTED:Hex High Entropy String] "PERF/UCT: Preserve address lengths in reachability checks" (Shachar Hasson), with follow-up f0ce700 "PERF/UCT: Report reachability reasons and align uGNI checks" — both on PR #12215 / branch cuda-loopback-reachability.

File: src/tools/perf/lib/libperf.c:820-823 (reported at libperf.c:843 in the PR tree); dereference site src/uct/cuda/cuda_ipc/cuda_ipc_iface_address.c:20 via src/uct/cuda/cuda_ipc/cuda_ipc_iface.c:175

Suggested fix: Pick one (first is minimal and matches the API contract):

  1. In uct_perf_test_setup_endpoints(), don't hand a NULL pointer with the field bit set — toggle the mask instead:
reachable_params.field_mask &= ~(UCT_IFACE_IS_REACHABLE_FIELD_IFACE_ADDR |
                                 UCT_IFACE_IS_REACHABLE_FIELD_IFACE_ADDR_LENGTH);
if (remote_info->uct.iface_addr_len != 0) {
    reachable_params.field_mask       |= UCT_IFACE_IS_REACHABLE_FIELD_IFACE_ADDR |
                                         UCT_IFACE_IS_REACHABLE_FIELD_IFACE_ADDR_LENGTH;
    reachable_params.iface_addr        = iface_addr;
    reachable_params.iface_addr_length = remote_info->uct.iface_addr_len;
}

(Transports that need the iface address — cuda_ipc included — always report a non-zero iface_addr_len, so the validity check in uct_iface_is_reachable_params_addrs_valid() still passes for them.)
2. Additionally harden cuda_ipc so a short/absent address can never be dereferenced: in uct_cuda_ipc_iface_address_unpack() return a sentinel (e.g. pid 0) when iface_addr == NULL || iface_addr_length < sizeof(pid_t), and skip the same-process check in uct_cuda_ipc_iface_is_reachable_v2() in that case.
3. Optionally make uct_iface_is_reachable_params_addrs_valid() also reject params->iface_addr == NULL / device_addr == NULL when the corresponding bits are set, so this class of bug fails loudly instead of segfaulting.

Related: PR #12215 (the PR under test); the NVLink-domain reachability change 3548954 (#12154) touches the same uct_cuda_ipc_iface_is_reachable_v2 function.

🛡️ This comment had 1 potential secret(s) redacted (Hex High Entropy String). See request_id f6fe966d-2beb-47d6-928d-b909a84440dc in the triage console for the audit trail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants