Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Fix infinite loop #1421

Merged
merged 1 commit into from
May 19, 2023
Merged

Fix infinite loop #1421

merged 1 commit into from
May 19, 2023

Conversation

ed255
Copy link
Member

@ed255 ed255 commented May 19, 2023

Description

Fix an infinite loop from a From implementation calling itself.

Issue Link

Resolve #1420
Related #1417

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Contents

@ChihChengLiang found that this issue was introduced in #1406 and by debugging on the debug build I found the infinite loop (which caused the stack to overflow which terminated the program with a segfault). The segfault is not observed in the release build, I guess the compiler optimizes the recursive call into an infinite loop, so the stack is never exhausted.

@github-actions github-actions bot added the crate-bus-mapping Issues related to the bus-mapping workspace member label May 19, 2023
@ed255 ed255 requested a review from ChihChengLiang May 19, 2023 12:02
Copy link
Collaborator

@ChihChengLiang ChihChengLiang left a comment

Choose a reason for hiding this comment

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

Nice catch!
Didn't know that into was that dangerous

@ed255
Copy link
Member Author

ed255 commented May 19, 2023

I'll merge this with one approve because it's a very small fix.

@ed255 ed255 enabled auto-merge May 19, 2023 12:48
@ChihChengLiang ChihChengLiang merged commit 70d7da4 into main May 19, 2023
@ChihChengLiang ChihChengLiang deleted the fix/infinite-loop branch May 19, 2023 13:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crate-bus-mapping Issues related to the bus-mapping workspace member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

testool run very slow after 69cb8a932
2 participants