You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: test_program_cache_tmp_dir_created_owner_only fails under a setgid parent directory #3214
I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Type of Bug
Something else (test-only failure)
Component
cuda.core
Describe the bug
With TMPDIR in a group-shared directory that has the setgid bit (mode 2770), cuda_core/tests/test_program_cache.py::test_program_cache_tmp_dir_created_owner_only fails:
AssertionError: tmp has mode 0o2700
FileStreamProgramCache creates tmp with mkdir(mode=0o700), and on Linux a new directory inherits S_ISGID from a setgid parent. The test compares stat.S_IMODE(...), which keeps the setgid bit, against 0o700. The directory is still owner-only: setgid on a directory only sets the group of new entries and grants no access. Under a parent without setgid, the same test passes.
(The group-shared parent must be one where you may set the setgid bit; any directory with mode 2770 reproduces it.)
Expected behavior
The test checks that tmp is owner-only, which it is; the inherited setgid bit does not grant access and should not fail it.
Proposed fix
Compare only the access bits, stat.S_IMODE(os.stat(root / "tmp").st_mode) & 0o777. With that change, the test passes under the setgid TMPDIR above. I can open a PR.
The fix was written with Claude Opus 5.5 and reviewed by the contributor.
Activity