Repository navigation
Labels
needs-triageIssues that need to be assigned.
Description
Description
Android application running with CoreCLR throws a SIGABRT trying to execute Ping.Send()
Reproduction Steps
private static readonly Ping PingSender = new();
reply = PingSender.Send(SOMEIPONTHELAN, 500);
in .NET Android App (tested with MAUI) on .NET 11 Preview 4 with dotnet run on physical hardware.
Expected behavior
Does not crash and Ping works as expected
Actual behavior
SIGABRT
--------- beginning of crash
05-27 15:26:39.806 15104 15215 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 15215 (Thread-26), pid 15104 (e.phoenix_tuner)
05-27 15:26:40.904 15104 15215 E DOTNET : Fatal error.
05-27 15:26:40.904 15104 15215 E DOTNET : Got a SIGABRT while executing native code. This usually indicates
05-27 15:26:40.904 15104 15215 E DOTNET : a fatal error in the runtime or one of the native libraries
05-27 15:26:40.904 15104 15215 E DOTNET : used by your application.
05-27 15:26:40.904 15104 15215 E DOTNET : at Interop+Sys.get_IsAtomicNonInheritablePipeCreationSupported()
05-27 15:26:40.904 15104 15215 E DOTNET : at System.Diagnostics.Process.Start()
05-27 15:26:40.904 15104 15215 E DOTNET : at System.Net.NetworkInformation.Ping.SendWithPingUtility(System.Net.IPAddress, Byte[], Int32, System.Net.NetworkInformation.PingOptions)
05-27 15:26:40.904 15104 15215 E DOTNET : at System.Net.NetworkInformation.Ping.Send(System.String, Int32)
05-27 15:26:40.904 15104 15215 E DOTNET : at MyApp.UpdateNetworkState()
05-27 15:26:40.905 15104 15215 E DOTNET : at System.Threading.Thread.StartCallback(System.Threading.Thread*)
05-27 15:26:40.905 15104 15215 F DOTNET : Aborting process.
Regression?
Not determined if regression or not.
Known Workarounds
No response
Configuration
Host OS: Windows 11
Android OS: Pixel 9A, Android 17.
.NET: 11.0.100-preview.4.26230.115
Other information
No response
Metadata
Metadata
Assignees
Labels
needs-triageIssues that need to be assigned.
Activity
dotnet-policy-service commentedon May 27, 2026
Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.
MihuBot commentedon May 27, 2026
I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):
dotnet-policy-service commentedon May 27, 2026
Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.
wfurt commentedon May 27, 2026
It seems to fail in code added by dotnet/runtime#125848 @adamsitnik
dotnet-policy-service commentedon May 27, 2026
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process
See info in area-owners.md if you want to be subscribed.
adamsitnik commentedon May 28, 2026
@BrzVlad @lateralusX I don't have any Android experience, could you please help me to understand how calling following code can cause
SIGABRT?https://github.com/dotnet/runtime/blob/15b34f616c22708246df76232450a9c4fdb2a2e4/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsAtomicNonInheritablePipeCreationSupported.cs#L11-L28
https://github.com/dotnet/runtime/blob/15b34f616c22708246df76232450a9c4fdb2a2e4/src/native/libs/System.Native/pal_io.c#L571-L578
The tests were passing fine on emulator (dotnet/runtime#126099)
lateralusX commentedon May 28, 2026
Any additional output in logcat when this happens? Do you have the tombstone for the same crash, that includes additional data and native stack traces. Does it repro the same way every time with the same managed callstack?
@mdh1418, if we hit an abort like this writing the managed stack on the thread handling the abort signal, I suspect that we also would get the regular Android crash report into logcat after the managed stack has been emitted? Possible for you to run this scenario on Android device to see how it behaves? A normal abort raised by the runtime or other native code using abort() should deliver it on the same thread, but there are also ways to queue an abort to the process, then it could be picked up by any thread that would dump its current managed stack, but that would then be misleading for that specific scenario since that thread would not be the source of the abort call, but the tombstone will probably tell what thread it originates from in that case.
daltzctr commentedon May 28, 2026
I don't remember seeing anything near the segfault in the logcat logs, unfortunately. I also haven't tried a blank MAUI app yet.
I can grab the tombstone, however I'd prefer to not share it here. Is there an email I can send to?
lateralusX commentedon May 28, 2026
The interesting thing is if there is a native stack trace including an abort call in the tombstone + any additional data around the abort signal itself, what pid and tid its associated with compared to the logcat output for the managed exception. If you can find and share that info that would be great. What I try to understand is what thread that triggers the abort, since the thread that handles it dumps the managed stack that is not in a code path that would trigger one. In parallel @mdh1418 could try to repro using a local Android device, if that succeeds, we will have all info needed.
daltzctr commentedon May 28, 2026
Hopefully this helps.
No idea if this is relevant, but has been in the past. Only android specific csproj settings I have ticked due to reliability issues in the past with
debugspecifically.mdh1418 commentedon May 28, 2026
I looked into trying to repro this issue from just the .NET Runtime only on my physical Android 16 device.
I couldn't reproduce the original Ping.Send crash because my device successfully creates raw ICMP sockets, so
Ping.Send()uses the raw socket code path instead of falling back toProcess.Start("/system/bin/ping"), meaning thatIsAtomicNonInheritablePipeCreationSupported()check is never reached, so no crash occurs.@lateralusX, For thread attribution, I double checked that calling
abort()from a named worker thread results in a crash report json that correctly attributes the crash to the worker thread.Looking at the tombstone provided,
seems to mean that there is a managed/native asset version mismatch in the .NET 11 Preview 4 Android runtime pack/MAUI workload. The
System.Diagnostics.Process.dllmight be referencing a P/Invoke entry point thatlibSystem.Native.sodoesn't export@jonathanpeppers does this look like a dotnet/android | dotnet/maui issue to you?
jonathanpeppers commentedon May 28, 2026
I don't know why this was done this way, but I think these need to be listed here:
android/src/native/clr/pinvoke-override/generate-pinvoke-tables.cc
Lines 175 to 432 in 0a7f632
I don't see
SystemNative_IsAtomicNonInheritablePipeCreationSupportedin the list.jkotas commentedon May 28, 2026
This list changing all the time. I expect that there are number of other methods missing.
Can you avoid duplicating it in the Android repo? Otherwise, these breaks are going to occur regularly.
jonathanpeppers commentedon May 28, 2026
I don't know the history of why it was duplicated at all -- are these considered internal APIs?
To fix it properly, we'd want a build step that generates from the .so file and not check these in.
jkotas commentedon May 28, 2026
Yes, these are considered internal implementation detail.
Why do you need this list in the first place?
jonathanpeppers commentedon May 28, 2026
I think this pattern is an optimization from when we were Mono-only, I think original details are in: #6210
It says it saved 100ms to startup in a .NET MAUI project, but I'm skeptical. From what I'm looking at, the hash avoids a path search per .so file in the app. There looks like there are only 5-6 .so files included by default.
lateralusX commentedon May 29, 2026
@daltzctr, that was exactly the information I was looking for, it clear indicates that the abort was called from the thread that dumps the managed callstack and then the additional abort message says it all and have direct the issue in the right direction.
@mdh1418, thanks for following up and testing the scenario with the crash reporter.
[CoreCLR] Remove dead dotnet_pinvokes generation
[tests] Add PingTest regression guard for BCL p/invoke drift
Sync SystemNative pinvoke tables with dotnet/runtime (#11531)
Sync SystemNative pinvoke tables with dotnet/runtime (#11531)
[CoreCLR] Stop serving BCL p/invokes from the precompiled override (#…