-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
AccessViolationException in HttpClient.SendAsync() on macOS arm64 in .NET 9 preview.4 #102313
Comments
Tagging subscribers to this area: @dotnet/ncl |
@martincostello any chance you can help us by collecting traces? This could give us some preliminary ideas before someone manages to jump on the issue.
|
Could this be the root cause? |
Sure, I'll try and do this later today.
I did spot that issue, but it seemed a bit too old to still be an issue in the nightlies? |
Just looked at this - how do I do this exactly when I don't know what the test process' ID will be until after I start the tests? |
I know this annoying. I often add |
BTW the linked issue blames |
At the moment my repro is just "run dotnet test" - I don't have anything more specific at the moment. I could maybe add something to the tests to have the tests start monitor itself (if that works?) I'm only seeing this on macOS, not Windows or Linux, but only in this one project. I'm not specifically using lib2gitsharp anywhere, and if it is being used, I would assume it's from an SDK or something and would/should be present in my other repos I'm testing nightlies with. |
If it helps narrow the search, this has started happening at some point since the 24th April, but all I had to go on was "dotnet test crashes" at that point and I figured it would stabilise at some point. It's only in the last day or so I've noticed it's progressed to not killing the whole process and giving me an exception message and stack trace. |
But that probably correlates more with GitHub Actions runners moving from macOS 12 x64 to macOS 14 arm64, so it was probably broken before then and my build was just on a different arch so I didnt see it before... |
I don't seem to be able to get hold of a If you let me know what the right secure process to provide the dump file is, I can provide one tomorrow. |
I'm possibly seeing this issue in a different repository using the official preview.4 build as well: logs. In that case, dotnet test is just outright crashing, rather than throwing an |
Yep, definitely an issue with the official .NET 9 preview.4 build: crash |
I've also spotted that sometimes instead of crashing, I get this instead: System.NullReferenceException : Object reference not set to an instance of an object.
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.InvokeAsync(MethodInfo method, Object instance, Object[] arguments)
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context, CancellationToken cancellationToken)
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
at MartinCostello.DotNetBumper.Bumper.RunAsync(IAnsiConsole console, String[] args, Func`2 configureLogging, CancellationToken cancellationToken) in /_/src/DotNetBumper/Bumper.cs:line 98
at MartinCostello.DotNetBumper.EndToEndTests.Application_Returns_Two_If_Cancelled_By_User() in /_/tests/DotNetBumper.Tests/EndToEndTests.cs:line 425
--- End of stack trace from previous location --- That appears to come from here: ExecuteMethodConvention.InvokeAsync() |
We don't own McMaster CommandLine utilities. We should focus on the It would be very helpful for us if there were crash dumps and if you could do some experiments that can help deciding whether we can exclude libgit2sharp or other 3rd party components as sources of memory corruption. Ideally there should be a repro that only uses HttpClient. |
@antonfirsov I have a crash dump - I just need to know how to securely give it to you: #102313 (comment) |
Sorry, I missed that. Can you send it over email? (anfirszo at companydomain). |
@antonfirsov The dump is 1.4GB compressed. Is there a secure file share to upload it to instead? @danmoseley Can you point me to the appropriate feedback thing that's used for this? I forget where it is. |
This seems to have stopped happening as of the |
Scratch that - it's just gotten less frequent. |
There should be a way to privately attach files to tickets opened on https://developercommunity.visualstudio.com. Alternatively, if there is a way for you to safely share it via a private link to OneDrive or similar, you can send me a link over email, I will let you know after downloading it so you can delete the share. |
I tried to use the feedback site, but the webpage OOMs in Chrome when I try and attach the ZIP file 😅 I'm just setting up a throw-away OneDrive share now, and I'll share it with the email address you provided earlier. |
@antonfirsov Just emailed you the link. |
Description
I have an application I'm testing against .NET 9 daily builds. With the latest SDK and package versions I'm seeing
System.AccessViolationException : Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
errors in my tests when running on GitHub Actions' macOS arm64 runners.I have 9 applications I'm doing this with, but I'm only observing this issue with one of them.
Reproduction Steps
build.ps1
on a macOS arm64 machine.Expected behavior
The tests all pass.
Actual behavior
Lots of test failures with a stack trace similar to the below:
That corresponds to this code, but it doesn't appear to have been recently changed:
runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs
Lines 520 to 556 in 8f3c687
Regression?
Yes.
Known Workarounds
None.
Configuration
.NET SDK
9.0.100-preview.4.24265.4
Other information
No response
The text was updated successfully, but these errors were encountered: