uutils / uutils/coreutils

tsort: incorrect loop detection

Open
#8,743 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

U - tsort
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Graph

  A B
  B C
  C B
  C D
  D A

So there are two loops:

A -> B -> C -> D -> A

B -> C -> B

dmis@dmis-asus-N7600PC:~/WORKSPACE/coreutils$ tsort loop.txt 
tsort: loop.txt: input contains a loop:
tsort: B
tsort: C
tsort: loop.txt: input contains a loop:
tsort: A
tsort: B
tsort: C
tsort: D
A
B
C
D
dmis@dmis-asus-N7600PC:~/WORKSPACE/coreutils$ target/debug/coreutils tsort loop.txt 
tsort: loop.txt: input contains a loop:
tsort: A
tsort: B
tsort: C
tsort: loop.txt: input contains a loop:
tsort: B
tsort: C
C
B
D
A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the graph shown in the tsort command output, comparing GNU tsort with target/debug/coreutils tsort. Trace the loop-detection entry point and its handling of the two cycles; done means the Rust implementation reports the same loops and produces compatible output.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.