Skip to content

tsort: refactor and make allocations safe - #14501

Draft
anastygnome wants to merge 2 commits into
uutils:mainfrom
anastygnome:tsort4
Draft

tsort: refactor and make allocations safe#14501
anastygnome wants to merge 2 commits into
uutils:mainfrom
anastygnome:tsort4

Conversation

@anastygnome

@anastygnome anastygnome commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

This PR makes most allocations safe

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/pid-pipe (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/rm/isatty (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/tail-n0f (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.
Note: The gnu test tests/unexpand/bounded-memory is now being skipped but was previously passing.
Congrats! The gnu test tests/seq/seq-epipe is now passing!

@anastygnome
anastygnome force-pushed the tsort4 branch 5 times, most recently from d7848b9 to d5e5cac Compare September 11, 2026 22:36
@anastygnome
anastygnome marked this pull request as draft September 13, 2026 07:47
@anastygnome anastygnome changed the title tsort: refactor parser and make its allocations safe tsort: refactor and make allocations safe Sep 13, 2026
@anastygnome
anastygnome marked this pull request as ready for review September 13, 2026 12:04
@anastygnome

Copy link
Copy Markdown
Contributor Author

ready to merge.

@sylvestre

Copy link
Copy Markdown
Contributor

sorry but what is the benefit?
this isn't a trivial change to review

@anastygnome

anastygnome commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

@sylvestre
Most changes are in the first commit and avoid panicking on allocation failures in the parser (and using memchr3_iter which is going to get more performance in newer releases)

the second commit is mostly doing the same graph related code and moving it to its own module for readability

@sylvestre

Copy link
Copy Markdown
Contributor

avoid panicking on allocation failures in the parser

ok but why ?
like i don't think we have any other programs dealing with that properly
and i don't think it will happen with tsort in real life, no?

@anastygnome

Copy link
Copy Markdown
Contributor Author

avoid panicking on allocation failures in the parser

ok but why ? like i don't think we have any other programs dealing with that properly and i don't think it will happen with tsort in real life, no?

I thought we were doing it elsewhere, my bad then, I guess we can keep the parser rework as it's cleaner as it is, though

@anastygnome
anastygnome marked this pull request as draft September 13, 2026 14:32
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