-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix stack overflow by adding a missing bang #479
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mrBliss
requested review from
denisshevchenko and
oneEdoubleD
as code owners
December 11, 2019 14:27
dcoutts
approved these changes
Dec 11, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
CodiePP
approved these changes
Dec 11, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks.
bors r+ |
🔒 Permission denied Existing reviewers: click here to make mrBliss a reviewer |
bors r+ |
iohk-bors bot
added a commit
that referenced
this pull request
Dec 11, 2019
479: Fix stack overflow by adding a missing bang r=dcoutts a=mrBliss The local `qProc` function in `Cardano.BM.Backend.Switchboard` loops by calling itself recursively, passing in the same `MVar MessageCounter` each time. However, `MessageCounter` was missing a bang on its `mcCountersMap` field, which contains `HM.HashMap Text Word64`. Even though the `HashMap` is a strict one, if you don't force it, you're still accumulating thunks. And as the `MVar` containing the `MessageCounter` was passed recursively, this resulted in a stack overflow instead of running out of (heap) memory. Fix it by adding the missing bang. This should fix IntersectMBO/cardano-node#370. Co-authored-by: Thomas Winant <[email protected]>
bors r+ |
iohk-bors bot
added a commit
that referenced
this pull request
Dec 11, 2019
479: Fix stack overflow by adding a missing bang r=CodiePP a=mrBliss The local `qProc` function in `Cardano.BM.Backend.Switchboard` loops by calling itself recursively, passing in the same `MVar MessageCounter` each time. However, `MessageCounter` was missing a bang on its `mcCountersMap` field, which contains `HM.HashMap Text Word64`. Even though the `HashMap` is a strict one, if you don't force it, you're still accumulating thunks. And as the `MVar` containing the `MessageCounter` was passed recursively, this resulted in a stack overflow instead of running out of (heap) memory. Fix it by adding the missing bang. This should fix IntersectMBO/cardano-node#370. Co-authored-by: Thomas Winant <[email protected]>
The local `qProc` function in `Cardano.BM.Backend.Switchboard` loops by calling itself recursively, passing in the same `MVar MessageCounter` each time. However, `MessageCounter` was missing a bang on its `mcCountersMap` field, which contains `HM.HashMap Text Word64`. Even though the `HashMap` is a strict one, if you don't force it, you're still accumulating thunks. And as the `MVar` containing the `MessageCounter` was passed recursively, this resulted in a stack overflow instead of running out of (heap) memory. Fix it by adding the missing bang. This should fix IntersectMBO/cardano-node#370. Signed-off-by: Alexander Diemand <[email protected]>
CodiePP
force-pushed
the
mrBliss/fix-stack-overflow
branch
from
December 11, 2019 15:40
327bdf4
to
da2001b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The local
qProc
function inCardano.BM.Backend.Switchboard
loops bycalling itself recursively, passing in the same
MVar MessageCounter
eachtime. However,
MessageCounter
was missing a bang on itsmcCountersMap
field, which contains
HM.HashMap Text Word64
. Even though theHashMap
is astrict one, if you don't force it, you're still accumulating thunks. And as
the
MVar
containing theMessageCounter
was passed recursively, thisresulted in a stack overflow instead of running out of (heap) memory.
Fix it by adding the missing bang.
This should fix IntersectMBO/cardano-node#370.