Repository navigation
RISCV64 stacktrace test fails with NativeAOT due to missing context #129792
Copy link
Copy link
Closed
Labels
arch-riscvRelated to the RISC-V architectureRelated to the RISC-V architecturearea-NativeAOT-coreclr
Milestone
Description
Activity
- addedarch-riscvRelated to the RISC-V architectureRelated to the RISC-V architecture
on Jun 24, 2026 - addeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Jun 24, 2026 dotnet-policy-service commented
on Jun 24, 2026 ContributorMore actionsTagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.cc @dotnet/samsung, @filipnavara,
Build steps:
# on osx-arm64 $ cd runtime $ docker run --rm -v$(pwd):/runtime -w /runtime -e ROOTFS_DIR=/crossrootfs/riscv64 -it ubuntu $ eng/common/native/install-dependencies.sh $ apt install -y python3-venv $ rootfsEnv="/usr/local/share/rootfs" && python3 -m venv "$rootfsEnv" && "$rootfsEnv/bin/python" -m pip install aiohttp zstandard && PYTHON_EXECUTABLE="$rootfsEnv/bin/python" ./eng/common/cross/build-rootfs.sh riscv64 noble --skipunmount --skipemulation $ os=linux; arch=riscv64 $ ./build.sh clr+libs --cross --arch $arch --os $os -c Release --bootstrap $ ./build.sh libs.tests --cross --arch $arch --os $os --use-bootstrap -c Release -p:TestNativeAot=true -p:ArchiveTests=true
Then scp test archive to riscv64 computer (k1) and run tests:
# from os-x64 $ scp artifacts/helix/tests/linux.AnyCPU.Release/System.Net.Http.Functional.Tests.zip k1:/tmp $ ssh k1 $ mkdir -p ~/naottstlibs/http && cd $_ $ unzip /tmp/System.Net.Http.Functional.Tests.zip &>/dev/null # run full HTTP test suite $ ./RunTests.sh --runtime-path foo # foo is needed just to satisfy this script; it doesn't use corerun in AOT mode... # run this specific test $ ./System.Net.Http.Functional.Tests -method System.Net.Http.Functional.Tests.HttpClientSendTest_Async.Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured
It probably doesn't capture context around async resumption (runtime async?); the sync variant of this test passes.
On linux-arm64, it passes:
$ root@426b2454e6c3:/httptst# ./System.Net.Http.Functional.Tests -method System.Net.Http.Functional.Tests.HttpClientSendTest_Async.Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured Running assembly:System.Net.Http.Functional.Tests, Version=11.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 ===== OperationCanceledException_WithOriginalCancellationToken BEGIN exceptionText ===== System.Threading.Tasks.TaskCanceledException: Useful information ---> System.OperationCanceledException: Useful information ---> System.Exception: Useful inner exception information --- End of inner exception stack trace --- at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>g__InterestingMethodInTheStackTrace|6_1(Func`1 exceptionFactory) in /runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs:line 1639 at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<>c__DisplayClass6_0.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>b__0(HttpRequestMessage, CancellationToken) in /runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs:line 1596 --- End of stack trace from previous location --- at System.Runtime.CompilerServices.RuntimeAsyncTaskContinuation.GetResult[T](Task, Byte&) in /runtime/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeAsyncTaskContinuation.cs:line 140 at System.Runtime.CompilerServices.RuntimeAsyncTaskContinuation.TaskContinuationResume.ResumeTaskContinuation(Continuation, Byte&) in /runtime/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeAsyncTaskContinuation.cs:line 163 at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken) in /runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 544 --- End of inner exception stack trace --- at System.Net.Http.HttpClient.HandleFailure(Exception, Boolean, HttpResponseMessage, CancellationTokenSource, CancellationToken, CancellationTokenSource) in /runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 644 at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken) in /runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 564 --- End of stack trace from previous location --- at Xunit.Assert.<RecordExceptionAsync>d__215.MoveNext() in /_/src/arcade/src/Microsoft.DotNet.XUnitAssert/src/Record.cs:line 139 ===== OperationCanceledException_WithOriginalCancellationToken END exceptionText ===== ===== OperationCanceledException_UnknownCancellationToken BEGIN exceptionText ===== System.Threading.Tasks.TaskCanceledException: Useful information ---> System.OperationCanceledException: Useful information ---> System.Exception: Useful inner exception information --- End of inner exception stack trace --- at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>g__InterestingMethodInTheStackTrace|6_1(Func`1 exceptionFactory) in /runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs:line 1639 at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<>c__DisplayClass6_0.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>b__0(HttpRequestMessage, CancellationToken) in /runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs:line 1601 --- End of stack trace from previous location --- at System.Runtime.CompilerServices.RuntimeAsyncTaskContinuation.GetResult[T](Task, Byte&) in /runtime/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeAsyncTaskContinuation.cs:line 140 at System.Runtime.CompilerServices.RuntimeAsyncTaskContinuation.TaskContinuationResume.ResumeTaskContinuation(Continuation, Byte&) in /runtime/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeAsyncTaskContinuation.cs:line 163 at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken) in /runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 544 --- End of inner exception stack trace --- at System.Net.Http.HttpClient.HandleFailure(Exception, Boolean, HttpResponseMessage, CancellationTokenSource, CancellationToken, CancellationTokenSource) in /runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 644 at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken) in /runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 564 --- End of stack trace from previous location --- at Xunit.Assert.<RecordExceptionAsync>d__215.MoveNext() in /_/src/arcade/src/Microsoft.DotNet.XUnitAssert/src/Record.cs:line 139 ===== OperationCanceledException_UnknownCancellationToken END exceptionText ===== ===== HttpRequestException BEGIN exceptionText ===== System.Net.Http.HttpRequestException: Useful information ---> System.Exception: Useful inner exception information --- End of inner exception stack trace --- at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>g__InterestingMethodInTheStackTrace|6_1(Func`1 exceptionFactory) in /runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs:line 1639 at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<>c__DisplayClass6_0.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>b__0(HttpRequestMessage, CancellationToken) in /runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs:line 1607 at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<>c__DisplayClass6_0.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>b__0(HttpRequestMessage _, CancellationToken cancellationToken) --- End of stack trace from previous location --- at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken) in /runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 544 --- End of stack trace from previous location --- at Xunit.Assert.<RecordExceptionAsync>d__215.MoveNext() in /_/src/arcade/src/Microsoft.DotNet.XUnitAssert/src/Record.cs:line 139 ===== HttpRequestException END exceptionText ===== ===== HttpRequestException_DuringCancellation BEGIN exceptionText ===== System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.Net.Http.HttpRequestException: Useful information ---> System.Exception: Useful inner exception information --- End of inner exception stack trace --- at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>g__InterestingMethodInTheStackTrace|6_1(Func`1 exceptionFactory) in /runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs:line 1639 at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<>c__DisplayClass6_0.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>b__0(HttpRequestMessage, CancellationToken) in /runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs:line 1607 --- End of stack trace from previous location --- at System.Runtime.CompilerServices.RuntimeAsyncTaskContinuation.GetResult[T](Task, Byte&) in /runtime/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeAsyncTaskContinuation.cs:line 140 at System.Runtime.CompilerServices.RuntimeAsyncTaskContinuation.TaskContinuationResume.ResumeTaskContinuation(Continuation, Byte&) in /runtime/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeAsyncTaskContinuation.cs:line 163 at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken) in /runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 544 --- End of inner exception stack trace --- at System.Net.Http.HttpClient.HandleFailure(Exception, Boolean, HttpResponseMessage, CancellationTokenSource, CancellationToken, CancellationTokenSource) in /runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 644 at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken) in /runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 564 --- End of stack trace from previous location --- at Xunit.Assert.<RecordExceptionAsync>d__215.MoveNext() in /_/src/arcade/src/Microsoft.DotNet.XUnitAssert/src/Record.cs:line 139 ===== HttpRequestException_DuringCancellation END exceptionText ===== ===== UnknownException BEGIN exceptionText ===== System.Exception: Useful information ---> System.Exception: Useful inner exception information --- End of inner exception stack trace --- at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>g__InterestingMethodInTheStackTrace|6_1(Func`1 exceptionFactory) in /runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs:line 1639 at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<>c__DisplayClass6_0.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>b__0(HttpRequestMessage, CancellationToken) in /runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs:line 1613 at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<>c__DisplayClass6_0.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>b__0(HttpRequestMessage _, CancellationToken cancellationToken) --- End of stack trace from previous location --- at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken) in /runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 544 --- End of stack trace from previous location --- at Xunit.Assert.<RecordExceptionAsync>d__215.MoveNext() in /_/src/arcade/src/Microsoft.DotNet.XUnitAssert/src/Record.cs:line 139 ===== UnknownException END exceptionText ===== ===== UnknownException_DuringCancellation BEGIN exceptionText ===== System.Exception: Useful information ---> System.Exception: Useful inner exception information --- End of inner exception stack trace --- at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>g__InterestingMethodInTheStackTrace|6_1(Func`1 exceptionFactory) in /runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs:line 1639 at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<>c__DisplayClass6_0.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>b__0(HttpRequestMessage, CancellationToken) in /runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs:line 1613 --- End of stack trace from previous location --- at System.Runtime.CompilerServices.RuntimeAsyncTaskContinuation.GetResult[T](Task, Byte&) in /runtime/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeAsyncTaskContinuation.cs:line 140 at System.Runtime.CompilerServices.RuntimeAsyncTaskContinuation.TaskContinuationResume.ResumeTaskContinuation(Continuation, Byte&) in /runtime/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeAsyncTaskContinuation.cs:line 163 at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken) in /runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 544 --- End of stack trace from previous location --- at Xunit.Assert.<RecordExceptionAsync>d__215.MoveNext() in /_/src/arcade/src/Microsoft.DotNet.XUnitAssert/src/Record.cs:line 139 ===== UnknownException_DuringCancellation END exceptionText ===== Finished System.Net.Http.Functional.Tests, Version=11.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 Tests run: 6, Errors: 0, Failures: 0, Skipped: 0. Time: 0.2227099s
note I had that debug line in this build as well:
--- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs @@ -1629,6 +1629,8 @@ or ExceptionScenario.HttpRequestException_DuringCancellation string exceptionText = ex.ToString(); + Console.WriteLine($"===== {scenario} BEGIN exceptionText =====\n{exceptionText}\n===== {scenario} END exceptionText ====="); + Assert.Contains(InterestingExceptionMessage, exceptionText); Assert.Contains(InterestingInnerExceptionMessage, exceptionText); Assert.Contains(nameof(InterestingMethodInTheStackTrace), exceptionText);
- removeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Jun 25, 2026 - added a commit that references this issue
on Jun 30, 2026 - added a commit that references this issue
on Jul 15, 2026 - locked and limited conversation to collaborators
on Jul 31, 2026
Metadata
Metadata
Assignees
Labels
arch-riscvRelated to the RISC-V architectureRelated to the RISC-V architecturearea-NativeAOT-coreclr
Type
Projects
- StatusShow more project fieldsNo status
After running all libraries and runtime tests in AOT mode on linux-riscv64 machine, I have found one issue:
This assertion fails:
runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs
Line 1634 in 46b72c7
I added a debug (Console.Write) line and found this: