-
Notifications
You must be signed in to change notification settings - Fork 902
Fixing Coverity Defects Part Deux #1130
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e5e169d
Fixes race condition defect found by Coverity
63eabbb
Fixes potential NRE defect found by Coverity
a94bb90
Resolves a NRE condition defect found by Coverity by adding an assert…
ad50712
Resolves a NRE condition defect found by Coverity by returning an err…
8909b99
Adds debug asserts that a potential NRE condition found COverity does…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixes potential NRE defect found by Coverity
- Loading branch information
There are no files selected for viewing
This file contains hidden or 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
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.
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.
Does this still retain the semantics? Shouldn't this be an explicit throw? Iirc, this is hooked up to a native callback, and doesn't -1 just stop the callback trying?
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.
I'd say some tests that verify that this does not change behavior should be good. If we can, we should explicitly throw from here.
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.
Throwing during native callback handling isn't kosher. It leaves the native library hanging.
Agreed, care to help add them? 😉
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.
The best unit test is seeing if XS crashes or not. :D Once this is merged in vNext, I'll do the binary bump in XS and test. (we don't ever return null, but I'll force it to)
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.
Actually, can we also make this a Debug.Assert?
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.
@Therzok If we never return
null
then there should be no harm in returning an error code to the native library if somehowcred == null
. Better than blowing up and leaving the native library wondering what happened./CC @nulltoken : thoughts?
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.
I'm thinking that we should be able to exercise this code path with something like
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.
@whoisj Any chance you could try and add this test above?
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.
@nulltoken sure, I can try to find time to work on this. I've been a combination of on vacation and super busy lately. I don't see my current load relaxing until Halloween, but I'll see what I can do. If we're blocking this PR on the work getting done it could be a while (or not - you never know!).