runtime icon indicating copy to clipboard operation
runtime copied to clipboard

[mono] Assertion at jit-info.c:918, condition '!ji->async'

Open vitek-karas opened this issue 2 months ago • 4 comments

Build Information

Build: 20251105.5, 20251105.1, 20251104.5

Build error leg or test failing: Loader.WorkItemExecution, the specific test failing is ExtendedLayoutTests.ExtendedLayout.ExtendedLayout_NoExtendedLayoutAttribute

Affected CI jobs: linux_x64_Release_AllSubsets_Mono_LLVMFULLAOT_RuntimeTests

Commit range: started to fail on 10/14 2025, but there's a large hole in data before that date, so it's possible it was earlier.

Summary

  • Native crash triggered by SIGABRT from Mono runtime assertion failure during test execution
  • Failures occur on linux_x64_Release_AllSubsets_Mono_LLVMFULLAOT_RuntimeTests job on linux x64 platform
  • AOT-only mode fails to load 'ExtendedLayout.dll.so', causing runtime errors in mono/metadata/jit-info.c
  • Mono runtime assertion at line 918 fails with condition '!ji->async' not met during test
  • Tests exit with code 0 instead of expected 100, resulting in test failure with exit code 1

Work Items

Work Item Job Name Build Console Log
Loader linux_x64_Release_AllSubsets_Mono_LLVMFULLAOT_RuntimeTests 20251105.5
View Extract
=================================================================
Native Crash Reporting
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

...
03:02:15.733 Running test: _ExtendedLayout::ExtendedLayoutTests.ExtendedLayout.ExtendedLayout_NoExtendedLayoutAttribute()
Failed to load AOT module '/datadisks/disk1/work/A14E093D/w/97AB0850/e/Loader/Loader/ExtendedLayout.dll.so' ('/datadisks/disk1/work/A14E093D/w/97AB0850/e/Loader/Loader/ExtendedLayout.dll') in aot-only mode.


=================================================================
Native Crash Reporting
=================================================================


...

=================================================================
Managed Stacktrace:
=================================================================
at <unknown> <0xffffffff>
* Assertion at /__w/1/s/src/mono/mono/metadata/jit-info.c:918, condition `!ji->async' not met
App Exit Code: 0
Expected: 100
Actual: 0
END EXECUTION - FAILED
+ test_exit_code=1
Full Log
Loader linux_x64_Release_AllSubsets_Mono_LLVMFULLAOT_RuntimeTests 20251105.1
View Extract
=================================================================
Native Crash Reporting
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

14:54:10.861 Running test: _ExtendedLayout::ExtendedLayoutTests.ExtendedLayout.ExtendedLayout_NoExtendedLayoutAttribute()
Failed to load AOT module '/datadisks/disk1/work/A4560917/w/A41B08D0/e/Loader/Loader/ExtendedLayout.dll.so' ('/datadisks/disk1/work/A4560917/w/A41B08D0/e/Loader/Loader/ExtendedLayout.dll') in aot-only mode.

=================================================================
Managed Stacktrace:
=================================================================
at <unknown> <0xffffffff>
* Assertion at /__w/1/s/src/mono/mono/metadata/jit-info.c:918, condition `!ji->async' not met
App Exit Code: 0
Expected: 100
Actual: 0
END EXECUTION - FAILED
+ test_exit_code=1
Full Log
Loader linux_x64_Release_AllSubsets_Mono_LLVMFULLAOT_RuntimeTests 20251104.5
View Extract
=================================================================
Native Crash Reporting
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

=================================================================
Native stacktrace:

...
02:55:15.378 Running test: _ExtendedLayout::ExtendedLayoutTests.ExtendedLayout.ExtendedLayout_NoExtendedLayoutAttribute()
Failed to load AOT module '/datadisks/disk1/work/AEE109AB/w/B2FB09E9/e/Loader/Loader/ExtendedLayout.dll.so' ('/datadisks/disk1/work/AEE109AB/w/B2FB09E9/e/Loader/Loader/ExtendedLayout.dll') in aot-only mode.


=================================================================
Native Crash Reporting
=================================================================


...

=================================================================
Managed Stacktrace:
=================================================================
at <unknown> <0xffffffff>
* Assertion at /__w/1/s/src/mono/mono/metadata/jit-info.c:918, condition `!ji->async' not met
App Exit Code: 0
Expected: 100
Actual: 0
END EXECUTION - FAILED
+ test_exit_code=1
Full Log

Error Message

{
  "ErrorMessage": [
    "Failed to load AOT module",
    "* Assertion at /__w/1/s/src/mono/mono/metadata/jit-info.c:918, condition \u0060!ji-\u003Easync\u0027 not met"
  ],
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Notes

The test only fails on the linux_x64_Release_AllSubsets_Mono_LLVMFULLAOT configuration, it passes in all other configs.

Report

Build Definition Test Pull Request
1196167 dotnet/runtime Loader.WorkItemExecution

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
1 1 1

Report

Build Definition Test Pull Request
1204837 dotnet/runtime Loader.WorkItemExecution
1204656 dotnet/runtime Loader.WorkItemExecution
1204467 dotnet/runtime Loader.WorkItemExecution
1204288 dotnet/runtime Loader.WorkItemExecution
1203861 dotnet/runtime Loader.WorkItemExecution
1203101 dotnet/runtime Loader.WorkItemExecution
1202589 dotnet/runtime Loader.WorkItemExecution
1201762 dotnet/runtime Loader.WorkItemExecution
1201228 dotnet/runtime Loader.WorkItemExecution
1200686 dotnet/runtime Loader.WorkItemExecution
1200207 dotnet/runtime Loader.WorkItemExecution
1199607 dotnet/runtime Loader.WorkItemExecution
1199144 dotnet/runtime Loader.WorkItemExecution
1198606 dotnet/runtime Loader.WorkItemExecution dotnet/runtime#121488
1198528 dotnet/runtime Loader.WorkItemExecution
1198197 dotnet/runtime Loader.WorkItemExecution
1198069 dotnet/runtime Loader.WorkItemExecution

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 17

vitek-karas avatar Nov 06 '25 12:11 vitek-karas

This is likely related to #119948 (maybe even a duplicate) There's a second issue that this test should be disabled for mono: https://github.com/dotnet/runtime/blob/6e1e6b1f34ac821c47364f5b0baf91d18e1fcbe7/src/tests/Loader/classloader/ExtendedLayout/ExtendedLayout.csproj#L6 But it still runs in the linux_x64_Release_AllSubsets_Mono_LLVMFULLAOT configuration (note that it currently doesn't run on any other configuration in extra-platforms).

vitek-karas avatar Nov 07 '25 10:11 vitek-karas

I started noticing some intermittent crashes in my Android application, and after analyzing the log, the reason is exactly as mentioned in the description of this issue.

Assertion at /__w/1/s/src/runtime/src/mono/mono/metadata/jit-info.c:918, condition `!ji->async' not met

8049 8336 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 8336 (Finalizer), pid 8049 (mydomain.myapp)

I added <MonoAotIncompatible>true</MonoAotIncompatible> to my csproj and now I will observe if the issue happens again. I will keep you informed about this.

luronumen avatar Dec 04 '25 16:12 luronumen

I also see many Assertion at /__w/1/s/src/runtime/src/mono/mono/metadata/jit-info.c:918, condition `!ji->async' not met after I released my app on NET10 with all nugets updated to latest versions. Before NET9 worked with no issues.

@luronumen were you able to solve the issue?

what if to add UseInterpreter true ?

rburnashev85 avatar Dec 08 '25 14:12 rburnashev85

Hi @rburnashev85 ,

Because this is an intermittent issue, we will only be able to confirm that the <MonoAotIncompatible>true</MonoAotIncompatible> workaround worked within a few days.

luronumen avatar Dec 08 '25 19:12 luronumen

Hi Guys,

The issue persists even after setting <MonoAotIncompatible>true</MonoAotIncompatible>.

Do you have any other suggestions for an workaround to this issue?

luronumen avatar Dec 10 '25 18:12 luronumen

The correct way to disable AOT would be to add <RunAOTCompilation>false</RunAOTCompilation>. If on .net10, you could also try using the coreclr runtime instead, but note that this is currently experimental (See https://learn.microsoft.com/en-us/dotnet/maui/whats-new/dotnet-10?view=net-maui-10.0#experimental-coreclr). A full symbolicated stacktrace or repro would be useful in order to investigate this. To symbolicate the trace, you will need:

  • dotnet-symbol tool (dotnet tool -g install dotnet-symbol)
  • Android NDK or any LLVM toolchain which contains the llvm-addr2line utility

After the above are available, follow these steps:

  1. Put the libraries mentioned in the crash stack trace in a local directory
  2. For each of the Microsoft shared libraries (e.g. libmonosgen-2.0.so) run: dotnet-symbol library-name.so
  3. The non-Microsoft may or may not have symbols embedded in them, the Android ones should have them.
  4. For each interesting frame from the trace collect the frame address (the pc column in the trace, prefix 0x is optional, as are all the leading zeros) and the library name and run: llvm-addr2line -aCifp -e library-name.so frame_address

For instance, for the trace line:

#00 pc 0x00000000000d77a4 /data/app/~~9Zfo4zOl7WqWCiDvRydiaQ==/com.example.app-enZujLkwQVZO0lw0cRXUvA==/split_config.arm64_v8a.apk!libmonosgen-2.0.so (BuildId: 67228244379e0d7698287264cbddfcea8c1e1cb3)

We'd run:

llvm-addr2line -aCifp -e libmonosgen-2.0.so d77a4

BrzVlad avatar Dec 10 '25 18:12 BrzVlad

Hi @BrzVlad ,

Thank you so much for your detailed description of this issue!

I replaced <MonoAotIncompatible>true</MonoAotIncompatible> with <RunAOTCompilation>false</RunAOTCompilation> in the csproj file and generated a new version of my Android application.

I will test it over the next few days and keep you informed if the issue happens again.

luronumen avatar Dec 11 '25 02:12 luronumen

I fixed my app with these set of parameters. I see in the google play console that crashes are gone. <UseInterpreter>true</UseInterpreter> <RunAOTCompilation>false</RunAOTCompilation> <PublishTrimmed>false</PublishTrimmed>

UseInterpreter didn't work alone. I think that RunAOTCompilation false solved the issue.

I am not sure about PublishTrimmed. My app became 50% larger in size. But I am afraid of disabling it now :D What do you think could it affect the issue?

Also I see in the logs that only specific types of phones were affected by the issue: POCO, Xiaomi and other chinese phones. No Samsung or Google phones.

rburnashev85 avatar Dec 11 '25 04:12 rburnashev85