Skip to content

split: accept overflow in --number option like GNU#10520

Open
naoNao89 wants to merge 1 commit intouutils:mainfrom
naoNao89:fix-split-overflow-10389
Open

split: accept overflow in --number option like GNU#10520
naoNao89 wants to merge 1 commit intouutils:mainfrom
naoNao89:fix-split-overflow-10389

Conversation

@naoNao89
Copy link
Contributor

Fixes #10389

where split rejected overflow values like 2^64. Now it matches GNU behavior by clamping to u64::MAX instead of erroring. Switched from parse_size_u64() to parse_size_u64_max() based on GNU's OVERFLOW_OK pattern. Added regression test to prevent future breakage.

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/split/fail. tests/split/fail is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)

@naoNao89 naoNao89 force-pushed the fix-split-overflow-10389 branch from 64ae96e to e31d74f Compare January 30, 2026 19:07
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/split/fail. tests/split/fail is passing on 'main'. Maybe you have to rebase?

@ChrisDryden
Copy link
Collaborator

I think we have to pull the upstream changes to the split utility, its changed to match this behavior

@ChrisDryden
Copy link
Collaborator

Actually I think the issue that this is fixing is incorrect, I am unable to replicate this on upstream

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

GNU testsuite comparison:

GNU test failed: tests/split/fail. tests/split/fail is passing on 'main'. Maybe you have to rebase?

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/pr/bounded-memory. tests/pr/bounded-memory is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/split/fail. tests/split/fail is passing on 'main'. Maybe you have to rebase?

@naoNao89 naoNao89 force-pushed the fix-split-overflow-10389 branch 3 times, most recently from 8fdf58d to a8ed2f8 Compare February 16, 2026 00:21
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/date/resolution. tests/date/resolution is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/split/fail. tests/split/fail is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/tty/tty-eof (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/cut/bounded-memory is now being skipped but was previously passing.
Note: The gnu test tests/dd/no-allocate is now being skipped but was previously passing.
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.
Note: The gnu test tests/unexpand/bounded-memory is now being skipped but was previously passing.
Congrats! The gnu test tests/cp/link-heap is now passing!
Congrats! The gnu test tests/cut/cut-huge-range is now passing!

@naoNao89 naoNao89 force-pushed the fix-split-overflow-10389 branch 2 times, most recently from 4485b6f to 0176ecb Compare February 16, 2026 00:58
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/date/resolution. tests/date/resolution is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/io-errors. tests/misc/io-errors is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/split/fail. tests/split/fail is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.
Congrats! The gnu test tests/cp/link-heap is now passing!
Congrats! The gnu test tests/cut/cut-huge-range is now passing!
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

Use parse_size_u64_max to accept overflow values and clamp them to u64::MAX.
Add MAX_FILES_CAP (100) to prevent hangs when creating output files.
Add MAX_BYTE_CHUNKS, MAX_LINE_CHUNKS, MAX_RR_CHUNKS constants to limit
chunks processed for each split mode.
@naoNao89 naoNao89 force-pushed the fix-split-overflow-10389 branch from 0176ecb to 91cc2da Compare February 16, 2026 06:47
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/split/fail. tests/split/fail is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/cut/cut-huge-range is now passing!
Skip an intermittent issue tests/pr/bounded-memory (was skipped on 'main', now failing)

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.

split: invalid number of chunks: '18446744073709551616'

2 participants