Repository navigation
Description
Current behavior 🐛
On feature/breakingchanges (Uno Platform 7.0, net11.0), the Android + NativeAOT SamplesApp aborts with a native libc fortify failure roughly 0.3–0.5 s after the runtime-test engine starts enumerating tests. The process dies before writing a single test result, so all five Tests - Android+NativeAOT Skia CI jobs fail with "The test results file … does not contain any results".
The abort, verbatim from logcat (test group 3, build 7.0-dev.569):
--------- beginning of crash
08-26 12:10:03.662 4678 4878 F libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x7c447e440768)
08-26 12:10:03.748 525 2499 I ActivityManager : Process uno.platform.samplesapp.skia.nativeaot (pid 4678) has died: fg TOP
08-26 12:10:03.751 356 356 I Zygote : Process 4678 exited cleanly (0)
There is no managed exception, no ART FATAL EXCEPTION, and no Java stack trace — it is a pure native abort. Nothing is written to /data/tombstones before the CI harness tears the emulator down, so no backtrace has been captured yet.
Characteristics, consistent across all five parallel test groups and every branch build since 2026-08-22:
- The crashing thread is always the guest Vulkan thread — its first appearance in logcat is
D goldfish_vulkan: ensureSyncDeviceFd: created sync device for current Vulkan process: N. - The crash always lands 0.3–0.5 s after the last managed log line,
I NativeAotFromAndroid: Filtering with group #N— i.e. exactly when the runtime-test engine finishes filtering and starts driving the UI. - The app is fully alive before that:
JavaInteropRuntimeloads,NativeAotRuntimeProvider.onCreate()runs, Skia/Vulkan initialises, the app renders frames (EGL_emulation: app_time_stats), and it writes its canary file. It is not a startup/trimming failure.
| Test group | pid / crashing tid | last managed line | abort |
|---|---|---|---|
| 0 | 4511 / 4707 | Filtering with group #0 @ 12:10:09.725 |
12:10:10.186 |
| 1 | 4702 / 4806 | Filtering with group #1 @ 12:10:35.976 |
12:10:36.303 |
| 2 | 4631 / 4825 | Filtering with group #2 @ 12:10:25.759 |
12:10:26.255 |
| 3 | 4678 / 4878 | Filtering with group #3 @ 12:10:02.971 |
12:10:03.662 |
| 4 | 4688 / — | Filtering with group #4 @ 12:10:10.507 |
12:10:10.966 (F line not captured) |
Expected behavior 🎯
The Android + NativeAOT SamplesApp should run the Uno Platform runtime-test suite to completion, as it did before the .NET 11 Preview 7 bump and as the non-AOT Android Skia flavour still does today on the same commit, same emulator image and same SkiaSharp version.
How to reproduce it (as minimally and precisely as possible) 🔬
Reproduces 5/5 jobs, every CI run, on the unoplatform/uno feature/breakingchanges branch. No separate repro project needed — it is the SamplesApp head built exactly as CI does it:
# .NET SDK 11.0.100-preview.7.26381.103 (pinned in build/ci/net11/_global.json)
# Android workload packs 37.0.0-preview.7.2131
dotnet publish src/SamplesApp/SamplesApp/SamplesApp.csproj \
-c Release \
-r android-x64 \
-f net11.0-android \
-p:UnoTargetFrameworkOverride=net11.0-android \
-p:ApplicationId=uno.platform.samplesapp.skia.nativeaot \
-p:SkiaPublishAot=true \
-p:SkiaSharpVersion=4.151.1Then install on an API 34 x86_64 emulator (-gpu swiftshader_indirect -no-window -memory 4096) and launch with the runtime-test autostart extras:
adb install .../uno.platform.samplesapp.skia.nativeaot-Signed.apk
ACT=$(adb shell cmd package resolve-activity --brief uno.platform.samplesapp.skia.nativeaot | tail -n 1 | tr -d '\r')
adb shell am start -n "$ACT" \
-e UITEST_RUNTIME_TEST_GROUP 0 \
-e UITEST_RUNTIME_TEST_GROUP_COUNT 5 \
-e UITEST_RUNTIME_AUTOSTART_RESULT_FILE /storage/emulated/0/Android/data/uno.platform.samplesapp.skia.nativeaot/files/TestResult.xml \
-e UITEST_RUNTIME_TESTS_FILTER fA==
adb logcatThe app dies shortly after NativeAotFromAndroid: Filtering with group #0 appears in logcat.
The full CI recipe lives in build/ci/tests/.azure-devops-tests-android-nativeaot-skia-build.yml (publish) and build/test-scripts/android-run-skia-runtime-tests.sh (install + launch + result polling).
Regression window 🔎
The Tests - Android+NativeAOT Skia stage on feature/breakingchanges went from fully green to fully red in a single commit range:
| CI build | Commit | NativeAOT stage |
|---|---|---|
7.0-dev.391 (227595) |
40c4a89814452996e2fa78bc30d68c7fcc3a1e9f |
✅ 5/5 green |
7.0-dev.392 (227658) |
9582c40fd26a70bf18f3166d764a1767c4dc6357 |
❌ 5/5 red |
40c4a8981..9582c40 contains exactly three commits — the merge of #24054 plus its two commits:
f42da0432d8— chore: Update to .NET 11 Preview 7c8242ccecda— chore: use Mono.Cecil 0.11.6
It has been red on every branch build since (2026-08-14 → today).
Note that the failure presented in two distinct phases, which is why this went unnoticed for a while:
- 2026-08-14 → 2026-08-22 —
Error: Activity class {…/crc6448f3b0362cbf4bc9.MainActivity} does not exist. Preview 7 changed the generated JCW type name prefix fromcrc64…toscrc64…, and the CI script hard-coded the old name. Fixed in fix(ci): Resolve the Android launcher activity dynamically #24120 (0589bca5b87, resolve the launcher activity viacmd package resolve-activity). - Since
f06611905(merge of fix(ci): Resolve the Android launcher activity dynamically #24120) → today — the activity resolves and the app launches correctly, revealing thepthread_mutex_lockabort described above. This is the currently unresolved failure.
What has been ruled out ✅
- Not the emulator or the Vulkan/Skia path in general. On the same branch build (
7.0-dev.569, ADO build 230320), the non-AOTTests - Android Skiastage runs the identical test suite on the identical emulator image and passes 5/5. The only build-flag delta between the two heads is-p:SkiaPublishAot=true -r android-x64. - Not SkiaSharp. Both Android heads resolve SkiaSharp 4.151.1 (
src/Directory.Build.targets:77is the default; the NativeAOT job's-p:SkiaSharpVersion=4.151.1is redundant). The 4.151.1 bump (738de3da678, 2026-08-09) was already in the last green NativeAOT run. - Not an Uno Platform-side regression in that window. The regression range contains only the .NET 11 Preview 7 + Mono.Cecil commits; no Uno source changed.
- Not a general branch health problem. On build 230320 every other stage is green (21 of 23); the only other red stage is
Tests - iOS Skia, which failed for an unrelated 90-minute agent timeout. - Not visible on master.
masteris still on .NET 10 and itsTests - Android+NativeAOT Skiastage passes (e.g. ADO builds 229621, 229680).
Workaround 🛠️
None known. The stage cannot currently gate anything, because build/ci/tests/.azure-devops-tests-android-nativeaot-skia.yml skips these jobs on PR builds (condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))), so only the branch's own CI build exercises them.
Renderer 🎨
Skia
Affected platforms 📱💻🖥️
Android (NativeAOT only — Mono/CoreCLR flavour unaffected)
Uno.Sdk version (and other relevant versions) 📦
Branch feature/breakingchanges (Uno Platform 7.0 development branch), built from source.
| Component | Version |
|---|---|
| .NET SDK | 11.0.100-preview.7.26381.103 (build/ci/net11/_global.json, rollForward: disable) |
| Target framework | net11.0-android, RID android-x64 |
Microsoft.Android.Sdk.Linux |
37.0.0-preview.7.2131 |
Microsoft.Android.Runtime.NativeAOT.37.android-x64 |
37.0.0-preview.7.2131 |
| SkiaSharp | 4.151.1 |
| Emulator | API 34, x86_64, -gpu swiftshader_indirect -no-window -memory 4096 |
| CI agent | Ubuntu (self-hosted Linux pool), KVM enabled |
The build emits warning XA1040: The NativeAOT runtime on Android is an experimental feature and not yet suitable for production use, so this may ultimately belong in dotnet/android — happy to move it there.
Anything else we need to know? 💬
@jonpryor — flagging you since this falls out of #24054 (the Preview 7 bump) and is squarely in NativeAOT-on-Android territory.
Two things that would help pin it down and that we can wire up on our side if useful:
- Tombstones.
build/test-scripts/android-run-skia-runtime-tests.shcurrently pulls only the test-result XML and alogcat -ddump. Adding anadb pull /data/tombstones(oradb shell cmd stats/bugreport) on failure would give a symbolicated native backtrace for the aborting thread instead of just the fortify line. - A narrower repro. The crash needs the runtime-test engine to actually start driving the UI, so a plain "launch the app" smoke test does not reproduce it — the app renders happily for several seconds first. If a smaller NativeAOT + Skia + Vulkan repro would help, tell us what shape you want and we will build it.
Public CI evidence (anonymous access):
- Failing branch build
7.0-dev.569: https://dev.azure.com/uno-platform/uno/_build/results?buildId=230320 - Logs/artifacts: pipeline artifact
runtime-tests-android-skia-nativeaot-resultscontainsandroid-device-log-RuntimeTests-{0..4}-RuntimeTests.txt(full logcat per group). - Last green NativeAOT build
7.0-dev.391: https://dev.azure.com/uno-platform/uno/_build/results?buildId=227595
Activity
jonpryor commentedon Aug 26, 2026
I am confused. 😅
I think (suspect?) that the
FORTIFY:message is a red herring.For "local repro and investigation" purposes, when I:
Run
emulator-uno,Begin logging:
adb logcat > log.txtInstall uno.platform.samplesapp.skia.nativeaot-Signed.apk from CI
adb install ~/Downloads/uno.platform.samplesapp.skia.nativeaot-Signed.apkRun the tests "like" CI does:
adb shell pm grant uno.platform.samplesapp.skia.nativeaot android.permission.WRITE_EXTERNAL_STORAGE adb shell pm grant uno.platform.samplesapp.skia.nativeaot android.permission.READ_EXTERNAL_STORAGE adb shell am start -n "uno.platform.samplesapp.skia.nativeaot/scrc6415f86cac20992436.MainActivity" \ -e UITEST_RUNTIME_TEST_GROUP 0 \ -e UITEST_RUNTIME_TEST_GROUP_COUNT 5 \ -e UITEST_RUNTIME_TESTS_FILTER fA== \ -e UITEST_RUNTIME_AUTOSTART_RESULT_FILE /storage/emulated/0/Android/data/uno.platform.samplesapp.skia.nativeaot/files/TestResult.xmlI see the app launch, and then ~immediately exit.
log.txt(from 2) contains:In this run, I don't have the
FORTIFY: pthread_mutex_lock called on a destroyed mutexmessage.I do have this message:
Similar-but-different, if I:
We see content resembling the original report --
FORTIFYmessage, etc. -- along with the "Process exited cleanly" message:What I suspect is happening is the following:
UITEST_RUNTIME_TEST_GROUP=0,UITEST_RUNTIME_TEST_GROUP_COUNT=5,UITEST_RUNTIME_TESTS_FILTER=fA==, andUITEST_RUNTIME_AUTOSTART_RESULT_FILE=…/TestResult*.xml…/TestResult*.xmlis saved.uno/src/SamplesApp/SamplesApp.Shared/App.Tests.cs
Lines 91 to 94 in ea3418a
Note line 94, which calls
Environment.Exit(0).It is after (during?) the
Environment.Exit(0)invocation that CI gets the "beginning of crash" message, and it's because we're in the "middle" of exiting the process that no stack trace/etc. can be provided: the process is gone, there's nothing to log!Meanwhile, (2) happens; from the Run Android+NativeAOT Skia Tests log:
TestResult-20260826120957.xmlwas created. We couldadb pullit. We did not crash before it could be written.The problem is that
TestResult-20260826120957.xmlis empty; when I run it locally, it has the contents:Note
testcasecount="0"andtotal="0".My assertion is that if any tests were executed, the Runtime Tests * stages would be green, even if
adb logcatmentions theFORTIFYmessage, because theFORTIFYmessage is written too late to be relevant.The problem is that we're not finding tests to run.
jonpryor commentedon Aug 26, 2026
Possibly related/variation on the analysis: dotnet/maui#32166 in which a MAUI app calls
Application.Current.Quit(), and crashes with a SIGSEGV (signal 11) -- which we don't observe here -- but does contain theFORTIFYmessages:jonpryor commentedon Aug 26, 2026
"Obvious followup is obvious": so why aren't any tests found?
This is Native AOT, so "debuggers" don't exist, so time to printf-debug this:
The above could use some improvements, but rebuilds are slow, so… relevant output:
That sounds good.
That's not good. At least this further confirms that no tests are being executed…
Circle back with MOAR printfs, now with counts!
…and that right there might be the problem? This is from:
meaning that despite having 33289 types, none have
[TestClass].It's thus time to cross-reference things. Do we have types with
[TestClass]? Yes:% git grep -1 '\[.*TestClass.*\]' src … src/SourceGenerators/Uno.UI.SourceGenerators.Tests/DependencyPropertyGeneratorTests/Given_DependencyPropertyGenerator.cs- src/SourceGenerators/Uno.UI.SourceGenerators.Tests/DependencyPropertyGeneratorTests/Given_DependencyPropertyGenerator.cs:[TestClass] src/SourceGenerators/Uno.UI.SourceGenerators.Tests/DependencyPropertyGeneratorTests/Given_DependencyPropertyGenerator.cs-public class Given_DependencyPropertyGenerator …Though not all matches are relevant. Consider the above:
src/SourceGeneratorsis not included inSamplesApp, so the above match doesn't matter. Nor doessrc/Uno.Analyzers.Tests, orsrc/Uno.HotReload.Tests, orsrc/Uno.UI.DevServer.Cli.E2E.Tests, or…What could matter?
src/Uno.UI.RuntimeTestsseems plausible:CalendarDatePickerIntegrationTestsdoes not appear inadb logcatoutput. Maybe…/dxaml/…isn't relevant either?The above is for
Uno.UI.RuntimeTests.MUX.Input.Focus.FocusTests, which does not appear inadb logcat.adb logcatdoes containUno.UI.Samples.Content.UITests.FocusTests.FocusManagerTest, but that's a[Sample]type, not a[TestClass]type.Spot checking
git grep …output, nothing insrc/Uno.UI.RuntimeTests/appears inadb logcateither. For example,Given_Uriisn't mentioned.Those tests are in
Uno.UI.RuntimeTests.dll, andUno.UI.RuntimeTestsis mentioned inadb logcat:However, what's odd is that
Given_Uriisn't found:My theory is that
Given_Uri-- and all other[TestClass]-attributed types -- are removed by the trimmer during Native AOT generation. What's preserved is all code referenced by[Sample]-attributed types.With that theory in mind, what if we told the linker to not trim that assembly?
With that change, tests actually run (yay), and
adb logcatcontains:It also takes considerably longer to run (shock!).
TestsResult.xmlcontains (abbreviated):test: unit test assemblies are trimmer roots
test: unit test assemblies are trimmer roots
test: unit test assemblies are trimmer roots