Skip to content

Conversation

@mattsu2020
Copy link
Contributor

As mentioned in the comment below, it hits the file descriptor limit.

#9554 (comment)

Make adjustments to reduce the use of FD.

Replace recursive safe_traverse_dir with iterative depth-first search using a stack to prevent file descriptor exhaustion during deep directory hierarchies. Also collect read_dir entries upfront to release the directory iterator early, reducing resource usage.
Use rlimit crate's .limit() method instead of manual libc rlimit calls for constraining NOFILE.
This cleans up the test code and leverages existing utilities in the rlimit crate.
Additionally, optimize import by using PathBuf directly from std::path.
@github-actions
Copy link

github-actions bot commented Dec 7, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/sort/sort-stale-thread-mem. tests/sort/sort-stale-thread-mem is passing on 'main'. Maybe you have to rebase?

@uutils uutils deleted a comment from github-actions bot Dec 26, 2025
@uutils uutils deleted a comment from github-actions bot Dec 26, 2025
mattsu2020 and others added 4 commits December 27, 2025 16:38
- Add new SMACK test job to GnuTests.yml with corresponding environment variables
- Remove unused dependencies (autopoint, texinfo, rustfmt) from CI jobs
- Enhance disk space management in CICD.yml by cleaning additional directories and adding df -h for monitoring
- Update spell-checker ignores to include zstd and cpio
- Add test for stty --all option to validate output parsing

These changes expand test coverage for security modules and improve CI efficiency by reducing disk usage and streamlining dependencies.
# Conflicts:
#	src/uu/chmod/src/chmod.rs
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

GNU testsuite comparison:

GNU test failed: tests/tty/tty-eof. tests/tty/tty-eof is passing on 'main'. Maybe you have to rebase?

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/stty/bad-speed is now passing!

… chown executors

Use match expressions for metadata retrieval to improve readability and reduce nesting. Hoist variable declarations for better scope management in ChownExecutor. These changes enhance code clarity without altering functionality.
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)


let entries = dir_fd.read_dir()?;
// Depth-first traversal without recursive calls to avoid stacking FDs.
let mut stack: Vec<(DirFd, PathBuf)> = vec![(dir_fd, dir_path.to_path_buf())];
Copy link
Contributor

Choose a reason for hiding this comment

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

did you look at the impact on the memory ?

mattsu2020 and others added 4 commits January 15, 2026 21:43
Add dev-dependencies (divan, tempfile, uucore with benchmark features) and a bench target for chmod_bench to enable performance benchmarking. This allows measuring and optimizing the chmod utility's efficiency.
- Added uu_chmod to the list of packages in the benchmarks workflow matrix to include it in performance testing alongside other utilities.
…trlimit calls

Wrap System allocator method calls (alloc, dealloc, realloc) and getrlimit in explicit unsafe blocks to satisfy Rust safety requirements and potential linting rules, improving code clarity in the benchmark file.
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 15, 2026

Merging this PR will degrade performance by 27.39%

⚡ 3 improved benchmarks
❌ 7 regressed benchmarks
✅ 242 untouched benchmarks
🆕 4 new benchmarks
⏩ 68 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory sort_unique_locale[500000] 33.6 MB 39.8 MB -15.5%
Memory sort_accented_data[500000] 22.1 MB 28.3 MB -21.79%
Memory sort_ascii_utf8_locale 6.7 MB 6.2 MB +7.93%
Memory sort_key_field[500000] 47.8 MB 51.8 MB -7.62%
Memory sort_long_line[160000] 712.6 KB 981.4 KB -27.39%
Memory sort_ascii_only[500000] 22.2 MB 28.3 MB -21.77%
Memory sort_numeric[500000] 75.5 MB 79.2 MB -4.66%
Memory sort_mixed_data[500000] 22.9 MB 27.1 MB -15.71%
🆕 Simulation chmod_recursive_wide_tree[(2000, 200)] N/A 4.8 ms N/A
🆕 Simulation chmod_recursive_deep_tree[(200, 2)] N/A 1.3 ms N/A
Memory du_deep_tree[(100, 3)] 157.9 KB 149.7 KB +5.43%
Memory cp_large_file[16] 119.6 KB 112.9 KB +5.88%
🆕 Memory chmod_recursive_deep_tree[(200, 2)] N/A 176.9 KB N/A
🆕 Memory chmod_recursive_wide_tree[(2000, 200)] N/A 297.3 KB N/A

Comparing mattsu2020:chmod_FD_fix (b0ba7fd) with main (2c75e71)

Open in CodSpeed

Footnotes

  1. 68 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Reorder divan and uucore::libc imports to alphabetical order for improved code consistency and readability.
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

Replace `&mut lim as *mut _` with `&raw mut lim` to use the newer,
more explicit Rust syntax for creating raw mutable pointers. This
improves code clarity and aligns with modern Rust idioms.
- Updated multiple crates including aho-corasick, anstream, anstyle, bitflags, unicode-ident, uuid, and others to their latest versions
- Added toml_parser crate as a new dependency
- Added codspeed-divan-compat and tempfile to uu_chmod dependencies
- This ensures compatibility, security fixes, and latest features from upstream crates
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tty/tty-eof (fails in this run but passes in the 'main' branch)

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.

2 participants