Skip to content

Users/jha shweta1/rccl emfile kernel version - #13034

Open
JhaShweta1 wants to merge 9 commits into
developfrom
users/JhaShweta1/rccl-emfile-kernel-version
Open

JhaShweta1 wants to merge 9 commits into
developfrom
users/JhaShweta1/rccl-emfile-kernel-version

Conversation

@JhaShweta1

@JhaShweta1 JhaShweta1 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

ncclGetUniqueId() crashed in strstr when a failed open left the kernel version string null.

Motivation

ncclGetUniqueId() terminated with SIGSEGV when /proc/version could not be opened, including when the process had exhausted its file descriptors. Initialization should return an ncclResult_t so the caller can recover.

Technical Details

ncclOsTopoGetStrFromSys() reports a failed read as success plus an empty string. ncclInit() then tokenized that buffer, got a null version string, and passed it to strstr. The null check now returns ncclSystemError before the strstr call and before call_once, so a later initialization can succeed once file descriptors are available.

Issue Tracking

JIRA ID: ROCM-31881

Test Plan

  1. rccl-UnitTestsMicroInit --gtest_filter='InitMicrotestIsolated.NcclInit_*'
  2. InitMicrotestIsolated.NcclInit_UnreadableKernelVersion_ReturnsSystemError covers the empty /proc/version path and a following successful ncclInit()

Test Result

All four InitMicrotestIsolated.NcclInit_* tests passed, including the empty-version case and a following successful ncclInit(). On unmodified develop, the empty-version case terminated with signal 11.

Submission Checklist

JhaShweta1 and others added 2 commits October 7, 2026 10:23
ncclGetUniqueId() crashed in strstr when a failed open left the kernel version string null.

Co-authored-by: Cursor <cursoragent@cursor.com>
The previous notes described a failed fopen as an empty string and treated a later retry as general.

Co-authored-by: Cursor <cursoragent@cursor.com>
@JhaShweta1
JhaShweta1 requested review from a team October 7, 2026 16:32
@therock-pr-bot

therock-pr-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ⚠️ Warning Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/rccl/src/init.cc, projects/rccl/test/host/fakes/os_fakes.cc, projects/rccl/test/host/init-test.cc; no test file found
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

therock-pr-bot Bot commented Oct 7, 2026

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Description

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ARGUS

Bottom line: Worth settling before approval: the new test never re-calls ncclInit(), so nothing pins the unlatched retry the fix exists for.

Comment @argus review to re-run, or @argus re-review after pushing.

Comment thread projects/rccl/test/host/init-test.cc Outdated
Comment thread projects/rccl/src/init.cc
Comment thread projects/rccl/CHANGELOG.md Outdated
Comment thread projects/rccl/src/init.cc
Comment thread projects/rccl/test/host/init-test.cc
The empty-/proc/version test only checked the first failure, so a latched initResult would still pass. The changelog now names every public caller of ncclInit.

Co-authored-by: Cursor <cursoragent@cursor.com>

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ARGUS

Bottom line: Looks approval ready. The fix and the unlatched-retry test both check out; the open question from last round about failing init outright on an unreadable /proc/version is a design call worth a reply.

Comment @argus review to re-run, or @argus re-review after pushing.

Comment thread projects/rccl/test/host/init-test.cc Outdated
JhaShweta1 and others added 2 commits October 8, 2026 14:46
The retry call was outside those hooks, so it read the host /proc/cmdline. Both calls now use the same fakes as the neighboring init tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ARGUS

Bottom line: LGTM once the comment at init-test.cc:4570 is corrected: NCCLCHECKGOTO assigns unconditionally, so the second ncclInit() does not catch the poisoned initResult the comment claims it does.

Comment @argus review to re-run, or @argus re-review after pushing.

Comment thread projects/rccl/test/host/init-test.cc Outdated
JhaShweta1 and others added 2 commits October 21, 2026 15:05
The second ncclInit() shows initOnceFlag was left unlatched. NCCLCHECKGOTO overwrites initResult, so that call does not catch a poisoned error.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ccl-emfile-kernel-version

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	projects/rccl/CHANGELOG.md

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ARGUS

Bottom line: LGTM.

Comment @argus review to re-run, or @argus re-review after pushing.

@github-actions

Copy link
Copy Markdown
Contributor

pr-rocm-systems-13034-oci-rccl-pr-smoke

Builds

Stack Component Version Commit Status Build time
pr-13034_rccl-debug_rocm-10.1-ga gcc-13.2 13.2.0 13.2.0 cached
pr-13034_rccl-debug_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-13034_rccl-debug_rocm-10.1-ga openmpi-5.0.8 5.0.8 5.0.8 cached
pr-13034_rccl-debug_rocm-10.1-ga rccl-pr-13034 4d94e7c 4d94e7c cached
pr-13034_rccl-debug_rocm-10.1-ga rccl_gtest-pr-13034-debug 4d94e7c 4d94e7c cached
pr-13034_rccl-perf_rocm-10.1-ga gcc-13.2 13.2.0 13.2.0 cached
pr-13034_rccl-perf_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-13034_rccl-perf_rocm-10.1-ga openmpi-5.0.8 5.0.8 5.0.8 cached
pr-13034_rccl-perf_rocm-10.1-ga rccl-pr-13034 4d94e7c 4d94e7c cached
pr-13034_rccl-perf_rocm-10.1-ga rccl-tests-develop-perf develop 26fb5d9 cached
pr-13034_rccl-perf_rocm-10.2-latest gcc-13.2 13.2.0 13.2.0 cached
pr-13034_rccl-perf_rocm-10.2-latest rocm-10.2-latest 10.2.0rc0 10.2.0rc0 cached
pr-13034_rccl-perf_rocm-10.2-latest openmpi-5.0.8 5.0.8 5.0.8 cached
pr-13034_rccl-perf_rocm-10.2-latest rccl-pr-13034 4d94e7c 4d94e7c cached
pr-13034_rccl-perf_rocm-10.2-latest rccl-tests-develop-perf develop 26fb5d9 cached
rocm-10.1-ga_rccl-develop-perf gcc-13.2 13.2.0 13.2.0 cached
rocm-10.1-ga_rccl-develop-perf rocm-10.1-ga 10.1.0 10.1.0 cached
rocm-10.1-ga_rccl-develop-perf openmpi-5.0.8 5.0.8 5.0.8 cached
rocm-10.1-ga_rccl-develop-perf rccl-develop develop 26fb5d9 cached
rocm-10.1-ga_rccl-develop-perf rccl-tests-develop-perf develop 26fb5d9 cached

Failures

No failing tests in this run.

15 tests skipped.

@github-actions

Copy link
Copy Markdown
Contributor

pr-rocm-systems-13034-ruby64-rccl-pr-smoke

Builds

Stack Component Version Commit Status Build time
pr-13034_rccl-debug_rocm-10.1-ga gcc-11.5 11.5.0 11.5.0 cached
pr-13034_rccl-debug_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-13034_rccl-debug_rocm-10.1-ga openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
pr-13034_rccl-debug_rocm-10.1-ga rccl-pr-13034 4d94e7c 4d94e7c cached
pr-13034_rccl-debug_rocm-10.1-ga rccl_gtest-pr-13034-debug 4d94e7c 4d94e7c cached
pr-13034_rccl-perf_rocm-10.1-ga gcc-11.5 11.5.0 11.5.0 cached
pr-13034_rccl-perf_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-13034_rccl-perf_rocm-10.1-ga openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
pr-13034_rccl-perf_rocm-10.1-ga rccl-pr-13034 4d94e7c 4d94e7c cached
pr-13034_rccl-perf_rocm-10.1-ga rcclt-develop-perf develop 26fb5d9 cached
pr-13034_rccl-perf_rocm-10.2-latest gcc-11.5 11.5.0 11.5.0 cached
pr-13034_rccl-perf_rocm-10.2-latest rocm-10.2-latest 10.2.0rc0 10.2.0rc0 cached
pr-13034_rccl-perf_rocm-10.2-latest openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
pr-13034_rccl-perf_rocm-10.2-latest rccl-pr-13034 4d94e7c 4d94e7c cached
pr-13034_rccl-perf_rocm-10.2-latest rcclt-develop-perf develop 26fb5d9 cached
rocm-10.1-ga_rccl-develop-perf gcc-11.5 11.5.0 11.5.0 cached
rocm-10.1-ga_rccl-develop-perf rocm-10.1-ga 10.1.0 10.1.0 cached
rocm-10.1-ga_rccl-develop-perf openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
rocm-10.1-ga_rccl-develop-perf rccl-develop develop 26fb5d9 cached
rocm-10.1-ga_rccl-develop-perf rcclt-develop-perf develop 26fb5d9 cached

Failures

No failing tests in this run.

15 tests skipped.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant