Skip to content

Fix an infinite loop in error reporting #4806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2017

Conversation

alexcrichton
Copy link
Member

The path_to_root function unfortunately didn't account for cycles in the
dependency graph introduced through dev-dependencies, so if a cycle was present
then the function would infinitely loop pushing items onto a vector.

This commit fixes the infinite loop and also touches up the reporting to be a
little more consistent with the rest of Cargo

The `path_to_root` function unfortunately didn't account for cycles in the
dependency graph introduced through dev-dependencies, so if a cycle was present
then the function would infinitely loop pushing items onto a vector.

This commit fixes the infinite loop and also touches up the reporting to be a
little more consistent with the rest of Cargo
@rust-highfive
Copy link

r? @matklad

(rust_highfive has picked a reviewer for you, use r? to override)

@matklad
Copy link
Member

matklad commented Dec 11, 2017

@bors r+

Hm, another place where we do tree walking is when traversing directories upwards. in theory, we might hit a cycle there as well because of links.

@bors
Copy link
Contributor

bors commented Dec 11, 2017

📌 Commit 4f0b8f8 has been approved by matklad

@bors
Copy link
Contributor

bors commented Dec 11, 2017

⌛ Testing commit 4f0b8f8 with merge 792ee85670db56e6adaf50c0143d989b4bb838fe...

@alexcrichton
Copy link
Member Author

@bors: retry

(prioritizing #4808)

Thanks for the review!

@bors
Copy link
Contributor

bors commented Dec 11, 2017

⌛ Testing commit 4f0b8f8 with merge 5b905422cb44d7ee50fdfd5806ee2e6a336f85ab...

@bors
Copy link
Contributor

bors commented Dec 11, 2017

💔 Test failed - status-travis

@alexcrichton
Copy link
Member Author

alexcrichton commented Dec 12, 2017 via email

@bors
Copy link
Contributor

bors commented Dec 12, 2017

⌛ Testing commit 4f0b8f8 with merge bc9ffdf...

bors added a commit that referenced this pull request Dec 12, 2017
Fix an infinite loop in error reporting

The `path_to_root` function unfortunately didn't account for cycles in the
dependency graph introduced through dev-dependencies, so if a cycle was present
then the function would infinitely loop pushing items onto a vector.

This commit fixes the infinite loop and also touches up the reporting to be a
little more consistent with the rest of Cargo
@bors
Copy link
Contributor

bors commented Dec 12, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: matklad
Pushing bc9ffdf to master...

@bors bors merged commit 4f0b8f8 into rust-lang:master Dec 12, 2017
@alexcrichton alexcrichton deleted the fix-infinite-loop branch December 18, 2017 19:47
@ehuss ehuss added this to the 1.24.0 milestone Feb 6, 2022
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.

5 participants