-
Notifications
You must be signed in to change notification settings - Fork 897
AccessViolationException on RetrieveStatus
#1886
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
Comments
I've done a few more things to identify the root cause of this.
This is the change where netstandard2.0 support was introduced, so that's most likely an issue with the different TFM OR with a change in LibGit2Sharp.NativeBinaries between v1.0.196 and v1.0.210. That looks to be the commit libgit2/libgit2sharp.nativebinaries@3ee0aa7, where in turn it seems like the changes are essentially just the changes from libgit2 libgit2/libgit2@2d2a602...6311e88. Why any of those changes might cause this crash is beyond me, as I'm unfamiliar with that code base, if it truly is from that change anyway. As said before, I'm happy to provide more information / try more things. This library is of great value to me, so I naturally would love to see this issue resolved without downgrading to an older version. Thanks |
We ran into the same issue after an update of Visual Studio to v16.10.1 - which updated the .NET Runtime to version 5.0.7. I published our app as a self-contained executable and pinned the .NET Runtime version to 5.0.6 via a global.json file.
With this change the Exception no longer appears. When going back to 5.0.7 the Exception occurs again, so it seems to be an issue with the .NET Runtime |
Do you know whether the dotnet runtime team is already aware of this regression? |
I have no idea, but i have not found any issue regarding this regression. BTW: setting the runtime version with a |
I've raised an issue in the dotnet/runtime repo: dotnet/runtime#53990 |
We have the same issue with 5.0.104 |
I noticed that using x64 does work for me |
Using x64 does not work for me. |
true, for me the combination of the global.json and x64 worked. Just one of them didn't do the trick. |
I debugged into the native code and saw that the With v5.0.6 the When manually moving the execution to the else branch, the code works as expected and without further errors |
Awesome, @Breakpoint21! So it seems like the bug is the unmatched property libgit2sharp/LibGit2Sharp/Core/GitStatusOptions.cs Lines 6 to 20 in df3b22a
and https://github.com/libgit2/libgit2/blob/508361401fbb5d87118045eaeae3356a729131aa/include/git2/status.h#L170-L197 The question now is whether it needs to be added in C# oder removed in C. |
It seems like it, but i wonder why this is working with older version of the runtime, since the |
Pure "luck"... It was never guaranteed to be always null, so it was only chance that interop put null there pre 5.0.7, which has kept the bug hidden. |
I just saw, that there is already a matching PR #1884 |
#1884 fixed this issue, so I recommend people affected by this to upgrade to 0.27.0-preview-0100. If anyone here is still experiencing AccessViolationExceptions with the newest version, when working with the newest dotnet runtime, I'd suggest to post it referencing this issue, as the root cause might be very similar. |
0.27.0-preview-0100 fixed the issue for me too 👍 |
great work @Molytho / @stefanloerwald |
I'm experiencing an issue which presumably originates from an update of git on my device (updated Visual Studio), but causes
AccessViolationException
in libgit2sharp.Reproduction steps
This happens with all repos on my device, regardless of what state the repo is in, it seems:
The second line throws the
System.AccessViolationException
(trace, see below)Expected behavior
No exception.
Actual behavior
Version of LibGit2Sharp (release number or SHA1)
I'm on version
0.27.0-preview-0096
.Operating system(s) tested; .NET runtime tested
Please let me know if you need further information to debug this.
Thanks
Stefan
The text was updated successfully, but these errors were encountered: