dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.93k stars 531 forks source link

Crash on android device with "Assertion at /__w/1/s/src/mono/mono/component/debugger-agent.c:5652" #8792

Closed AArnott closed 7 months ago

AArnott commented 8 months ago

Android application type

.NET Android (net7.0-android, net8.0-android, etc.)

Affected platform version

VS 2022 17.9.2

Description

My android app starts on an android device, and quickly crashes with this in the debug output window:

Assertion at /__w/1/s/src/mono/mono/component/debugger-agent.c:5652, condition `extra_space != NULL && *extra_space != NULL' not met [libc] Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 5599 (bank.eZcash.App), pid 5599 (bank.eZcash.App)

Steps to Reproduce

This doesn't repro on the most simple app that executes the same code that crashes in the original, so I'm not sure what else the app is doing or has done previously to get it into a state where the code fails. But for what it's worth, the method that just starts when the app crashes is:

public static Bip39Mnemonic Create(int entropyLengthInBits, ReadOnlyMemory<char> password)
{
    Requires.Argument(entropyLengthInBits % 32 == 0, nameof(entropyLengthInBits), Strings.MustBeNonZeroMultipleOf32);
    Span<byte> entropy = stackalloc byte[entropyLengthInBits / 8];
    RandomNumberGenerator.Fill(entropy);
    return new(entropy, password);
}

Note that a breakpoint set on the opening { is hit, but before I can even hit F10 to Step in the debugger, the app then crashes. It crashes whether or not the debugger is attached, though the crash without the debugger might be for another cause -- I can't tell.

Did you find any workaround?

No

Relevant log output

Here is the tail of the debug log:

[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Serialization.Primitives.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Encoding.Extensions.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Text.Encoding.Extensions.dll [External]
Resolved pending breakpoint at 'Bip39Mnemonic.cs:94,1' to Nerdbank.Bitcoin.Bip39Mnemonic Nerdbank.Bitcoin.Bip39Mnemonic.Create (int entropyLengthInBits, System.ReadOnlyMemory<char> password) [0x00000].
[bank.eZcash.App] * Assertion at /__w/1/s/src/mono/mono/component/debugger-agent.c:5652, condition `extra_space != NULL && *extra_space != NULL' not met
[libc] Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 5599 (bank.eZcash.App), pid 5599 (bank.eZcash.App)
[bank.eZcash.App] Background concurrent mark compact GC freed 12233(6984KB) AllocSpace objects, 0(0B) LOS objects, 91% free, 2221KB/26MB, paused 523us,5.172ms total 17.965ms
grendello commented 8 months ago

@thaystg would you mind taking a look at this? Thanks! :)

thaystg commented 8 months ago

Can you please test the same app using .NET 8.0.3? I fixed something that can be related. Please install the 8.0.3 and then install the workloads and test again. https://github.com/dotnet/runtime/pull/97568

AArnott commented 8 months ago

Wonderful that you may have already fixed it. How do I install .NET 8.0.3 on the device? https://dotnet.microsoft.com/en-us/download/dotnet/8.0 suggests that 8.0.2 is the latest version. I believe I would control the runtime version on the device by controlling the SDK version, correct?

thaystg commented 8 months ago

Hum. It's not shipped yet. Also you are reproducing it on .net7 also? So it's not what I fixed. Can you please run this adb command: adb shell setprop debug.mono.env "'MONO_SDB_ENV_OPTIONS=loglevel=10' And then send us the log that is printed in the output window of VS? Thanks.

AArnott commented 8 months ago

@thaystg I've attached the output window log after running the command and repro'ing the crash: outputwindow.txt

This is while targeting .NET 8. This app's primary dependency is a library that targets .NET 8, so testing on .NET 7 would be non-trivial.

thaystg commented 8 months ago

Oh, okay. You didn't reproduce it on .net7 because it's hard to test, right? So I suggest to wait .net8 8.0.3 that will be shipped very soon. And if it's still reproducing then we continue the investigation. I really think it's related with what I fixed.

AArnott commented 8 months ago

Sounds good. Hopefully 8.0.3 will come out tomorrow, since it's Patch Tuesday. :)

AArnott commented 8 months ago

@thaystg 8.0.3 still fails. Here is the debug output:

This debug engine does not support exception conditions. The condition(s) will be ignored.
Start debugging Android application ...
Forwarding debugger port 8830
Detecting existing process
> am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.Nerdbank.eZcash.App/crc64a0e84cdf92481b2c.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.Nerdbank.eZcash.App/crc64a0e84cdf92481b2c.MainActivity }
[bank.eZcash.App] Late-enabling -Xcheck:jni
[bank.eZcash.App] Using CollectorTypeCMC GC.
[CompatibilityChangeReporter] Compat change id reported: 171979766; UID 10469; state: ENABLED
[CompatibilityChangeReporter] Compat change id reported: 242716250; UID 10469; state: ENABLED
[ziparchive] Unable to open '/data/app/~~3uK1nTOp_6DYI_XaGmmQRQ==/com.Nerdbank.eZcash.App-iEMBkLGvcLmRuw2QZ9BDSQ==/base.dm': No such file or directory
[ziparchive] Unable to open '/data/app/~~3uK1nTOp_6DYI_XaGmmQRQ==/com.Nerdbank.eZcash.App-iEMBkLGvcLmRuw2QZ9BDSQ==/base.dm': No such file or directory
[nativeloader] Configuring clns-4 for other apk /data/app/~~3uK1nTOp_6DYI_XaGmmQRQ==/com.Nerdbank.eZcash.App-iEMBkLGvcLmRuw2QZ9BDSQ==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~3uK1nTOp_6DYI_XaGmmQRQ==/com.Nerdbank.eZcash.App-iEMBkLGvcLmRuw2QZ9BDSQ==/lib/arm64:/data/app/~~3uK1nTOp_6DYI_XaGmmQRQ==/com.Nerdbank.eZcash.App-iEMBkLGvcLmRuw2QZ9BDSQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.Nerdbank.eZcash.App
[GraphicsEnvironment] Currently set values for:
[GraphicsEnvironment]   angle_gl_driver_selection_pkgs=[]
[GraphicsEnvironment]   angle_gl_driver_selection_values=[]
[GraphicsEnvironment] ANGLE GameManagerService for com.Nerdbank.eZcash.App: false
[GraphicsEnvironment] com.Nerdbank.eZcash.App is not listed in per-application setting
[GraphicsEnvironment] Neither updatable production driver nor prerelease driver is supported.
[debug-app-helper] Checking if libmonodroid was unpacked to /data/app/~~3uK1nTOp_6DYI_XaGmmQRQ==/com.Nerdbank.eZcash.App-iEMBkLGvcLmRuw2QZ9BDSQ==/lib/arm64/libmonodroid.so
[debug-app-helper] Native libs extracted to /data/app/~~3uK1nTOp_6DYI_XaGmmQRQ==/com.Nerdbank.eZcash.App-iEMBkLGvcLmRuw2QZ9BDSQ==/lib/arm64, assuming application/android:extractNativeLibs == true
[debug-app-helper] Setting up for DSO lookup in app data directories
[debug-app-helper] Added filesystem DSO lookup location: /data/app/~~3uK1nTOp_6DYI_XaGmmQRQ==/com.Nerdbank.eZcash.App-iEMBkLGvcLmRuw2QZ9BDSQ==/lib/arm64
[debug-app-helper] Using runtime path: /data/app/~~3uK1nTOp_6DYI_XaGmmQRQ==/com.Nerdbank.eZcash.App-iEMBkLGvcLmRuw2QZ9BDSQ==/lib/arm64
[debug-app-helper] checking directory: `/data/user/0/com.Nerdbank.eZcash.App/files/.__override__/lib`
[debug-app-helper] directory does not exist: `/data/user/0/com.Nerdbank.eZcash.App/files/.__override__/lib`
[debug-app-helper] Checking whether Mono runtime exists at: /data/user/0/com.Nerdbank.eZcash.App/files/.__override__/libmonosgen-2.0.so
[debug-app-helper] Checking whether Mono runtime exists at: /data/app/~~3uK1nTOp_6DYI_XaGmmQRQ==/com.Nerdbank.eZcash.App-iEMBkLGvcLmRuw2QZ9BDSQ==/lib/arm64/libmonosgen-2.0.so
[debug-app-helper] Mono runtime found at: /data/app/~~3uK1nTOp_6DYI_XaGmmQRQ==/com.Nerdbank.eZcash.App-iEMBkLGvcLmRuw2QZ9BDSQ==/lib/arm64/libmonosgen-2.0.so
[bank.eZcash.App] Attempt to remove non-JNI local reference
[DOTNET] JNI_OnLoad: JNI_OnLoad in pal_jni.c
[DOTNET] GetOptionalClassGRef: optional class com/android/org/conscrypt/OpenSSLEngineImpl was not found
[monodroid] Creating public update directory: `/data/user/0/com.Nerdbank.eZcash.App/files/.__override__`
[bank.eZcash.App] Attempt to remove non-JNI local reference
[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8830,server=y,embedding=1,timeout=1710385496
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Private.CoreLib.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Nerdbank.Zcash.App.Android.dll
[monodroid-gc] GREF GC Threshold: 46080
[monodroid-assembly] open_from_bundles: failed to load assembly Mono.Android.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Java.Interop.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.InteropServices.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Nerdbank.Zcash.App.Android.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Mono.Android.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Runtime.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Java.Interop.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Runtime.InteropServices.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Collections.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Mono.Android.Runtime.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Mono.Android.Runtime.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Threading.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.Thread.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Diagnostics.StackTrace.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Threading.Thread.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Diagnostics.StackTrace.dll [External]
[bank.eZcash.App] Attempt to remove non-JNI local reference
[vulkan] searching for layers in '/data/app/~~3uK1nTOp_6DYI_XaGmmQRQ==/com.Nerdbank.eZcash.App-iEMBkLGvcLmRuw2QZ9BDSQ==/lib/arm64'
[vulkan] searching for layers in '/data/app/~~3uK1nTOp_6DYI_XaGmmQRQ==/com.Nerdbank.eZcash.App-iEMBkLGvcLmRuw2QZ9BDSQ==/base.apk!/lib/arm64-v8a'
[monodroid-assembly] open_from_bundles: failed to load assembly Avalonia.Android.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.AppCompat.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Fragment.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Activity.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Core.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.Common.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.ViewModel.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.SavedState.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.DrawerLayout.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CustomView.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Avalonia.Android.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Xamarin.AndroidX.AppCompat.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Xamarin.AndroidX.Fragment.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Xamarin.AndroidX.Activity.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Xamarin.AndroidX.Core.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Xamarin.AndroidX.Lifecycle.Common.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Xamarin.AndroidX.Lifecycle.ViewModel.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Xamarin.AndroidX.SavedState.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Xamarin.AndroidX.DrawerLayout.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Xamarin.AndroidX.CustomView.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Memory.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Memory.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Loader.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Xamarin.AndroidX.Loader.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Reflection.Emit.Lightweight.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Reflection.Emit.ILGeneration.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Reflection.Primitives.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Reflection.Emit.Lightweight.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Reflection.Emit.ILGeneration.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Reflection.Primitives.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Avalonia.Controls.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Avalonia.Base.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.ObjectModel.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Avalonia.Controls.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Avalonia.Base.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.ObjectModel.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Nerdbank.Zcash.App.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Nerdbank.Zcash.App.dll
[AppCompatDelegate] Checking for metadata for AppLocalesMetadataHolderService : Service not found
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.Primitives.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Avalonia.OpenGL.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.ComponentModel.Primitives.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Avalonia.OpenGL.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.Threading.dll
[monodroid-assembly] open_from_bundles: failed to load assembly MessagePack.Annotations.dll
[monodroid-assembly] open_from_bundles: failed to load assembly ReactiveUI.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Splat.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Microsoft.VisualStudio.Threading.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/MessagePack.Annotations.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/ReactiveUI.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Splat.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Avalonia.Fonts.Inter.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Avalonia.ReactiveUI.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Avalonia.Fonts.Inter.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Avalonia.ReactiveUI.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Avalonia.Skia.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Avalonia.Skia.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Private.Uri.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Private.Uri.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Linq.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Linq.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly SkiaSharp.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.Concurrent.dll
[monodroid-assembly] open_from_bundles: failed to load assembly HarfBuzzSharp.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/SkiaSharp.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Collections.Concurrent.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/HarfBuzzSharp.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.InteropServices.RuntimeInformation.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Runtime.InteropServices.RuntimeInformation.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Console.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Console.dll [External]
Thread started:  #2
[libEGL] loaded /vendor/lib64/egl/libGLES_mali.so
Thread started: .NET Timer #3
Thread started: <Thread Pool> #4
Thread started: .NET TP Gate #5
Thread started: <Thread Pool> #6
[monodroid-assembly] open_from_bundles: failed to load assembly System.Reactive.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Reactive.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.ComponentModel.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Avalonia.Metal.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Avalonia.Metal.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Linq.Expressions.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Linq.Expressions.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.TypeConverter.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.ComponentModel.TypeConverter.dll [External]
[0:] LogHost: Initializing to normal mode (.cctor)
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.Validation.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Microsoft.VisualStudio.Validation.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.Tasks.Dataflow.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Nerdbank.Cryptocurrencies.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Nerdbank.Zcash.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Threading.Tasks.Dataflow.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Nerdbank.Cryptocurrencies.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Nerdbank.Zcash.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.Immutable.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Collections.Immutable.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Avalonia.Markup.Xaml.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Avalonia.Markup.Xaml.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Avalonia.Themes.Fluent.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Avalonia.Controls.DataGrid.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Avalonia.Themes.Fluent.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Avalonia.Controls.DataGrid.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.CompilerServices.Unsafe.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Runtime.CompilerServices.Unsafe.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Avalonia.Dialogs.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Avalonia.Dialogs.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Avalonia.Markup.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Avalonia.Markup.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.Annotations.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Net.Http.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.ComponentModel.Annotations.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Net.Http.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Net.Primitives.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Net.Primitives.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Diagnostics.DiagnosticSource.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Security.Cryptography.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Diagnostics.DiagnosticSource.dll [External]
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Security.Cryptography.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Diagnostics.Tracing.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Diagnostics.Tracing.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.NonGeneric.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Collections.NonGeneric.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Net.Requests.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Net.Requests.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Numerics.Vectors.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Numerics.Vectors.dll [External]
[bank.eZcash.App] Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (unsupported, reflection, allowed)
[bank.eZcash.App] Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed)
[CompatibilityChangeReporter] Compat change id reported: 237531167; UID 10469; state: DISABLED
[monodroid-assembly] open_from_bundles: failed to load assembly en-US/Nerdbank.Zcash.App.resources.dll
[monodroid-assembly] open_from_bundles: failed to load assembly en-US/Nerdbank.Zcash.App.resources.dll
**System.IO.FileNotFoundException:** ''

The thread 4 has exited with code 0 (0x0).
Thread finished: <Thread Pool> #4
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Serialization.Primitives.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Runtime.Serialization.Primitives.dll [External]
Thread started: <Thread Pool> #7
[monodroid-assembly] open_from_bundles: failed to load assembly en/Nerdbank.Zcash.App.resources.dll
[monodroid-assembly] open_from_bundles: failed to load assembly en/Nerdbank.Zcash.App.resources.dll
**System.IO.FileNotFoundException:** ''

[bank.eZcash.App] Explicit concurrent mark compact GC freed 1570(328KB) AllocSpace objects, 0(0B) LOS objects, 89% free, 2751KB/26MB, paused 357us,4.930ms total 40.214ms
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Intrinsics.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Runtime.Intrinsics.dll [External]
[Choreographer] Skipped 4009 frames!  The application may be doing too much work on its main thread.
[ProfileInstaller] Installing profile for com.Nerdbank.eZcash.App
[monodroid-assembly] Shared library 'android' not loaded, p/invoke 'ANativeWindow_fromSurface' may fail
[AVALONIA] Surface Created
[bank.eZcash.App] PIXEL: ioctl err: 1
[bank.eZcash.App] PIXEL: ioctl err: 1
[AVALONIA] Surface Changed
[Choreographer] Skipped 50 frames!  The application may be doing too much work on its main thread.
[bank.eZcash.App] PIXEL: ioctl err: 1
[ImeTracker] com.Nerdbank.eZcash.App:b39396dd: onRequestHide at ORIGIN_CLIENT_HIDE_SOFT_INPUT reason HIDE_SOFT_INPUT
[monodroid-assembly] open_from_bundles: failed to load assembly Nerdbank.Bitcoin.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/Nerdbank.Bitcoin.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Encoding.Extensions.dll
Loaded assembly: /data/data/com.Nerdbank.eZcash.App/files/.__override__/System.Text.Encoding.Extensions.dll [External]
Resolved pending breakpoint at 'Bip39Mnemonic.cs:94,1' to Nerdbank.Bitcoin.Bip39Mnemonic Nerdbank.Bitcoin.Bip39Mnemonic.Create (int entropyLengthInBits, System.ReadOnlyMemory<char> password) [0x00000].
[bank.eZcash.App] * Assertion at /__w/1/s/src/mono/mono/component/debugger-agent.c:5698, condition `extra_space != NULL && *extra_space != NULL' not met
[libc] Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 2461 (bank.eZcash.App), pid 2461 (bank.eZcash.App)
thaystg commented 8 months ago

I think the log that I asked you are not enabled, I will share the steps with more details: Following the steps below in VS: 1 - Ensure you have an Android emulator or device selected in the debug targets list in VS 2 - Tools > Android > Android ADB Command Prompt… 3 - Write the following command in the opened command prompt and press enter: adb shell setprop debug.mono.env "'MONO_SDB_ENV_OPTIONS=loglevel=10'" 4 - Try to start a debug session (F5) 5 - Wait for the issue to reproduce and go to the Debug Output pane in VS 6 - Select all the content of the pane and paste it here (or attach it to a .txt file) If the extra logging worked, you should see some [mono] pre-fixed log entries in there."

AArnott commented 8 months ago

Sorry about not getting it right the first time. Here it is. I've confirmed that it has [mono] lines in it.

android.debug.txt

thaystg commented 8 months ago

Thanks, I was able to reproduce it locally. I'm fixing it!

AArnott commented 8 months ago

Great! Thank you for the fast turnaround of this. Once your fix merges, would installing a nightly build of the SDK be the way to build an android app and install on a device with the fix?

AArnott commented 7 months ago

@thaystg I tested with the 9.0.100-preview.2.24157.14 SDK, and the crash still repros. Is your fix there?

AArnott commented 7 months ago

Oh, I guess it wouldn't be, since that SDK was released a week before your fix was merged. :(

AArnott commented 7 months ago

I tried installing the latest nightly build of the .NET 9 SDK, but it failed with this:

Workload installation failed: One or more errors occurred. (Version 17.2.8029 of package microsoft.ios.sdk.msi.arm64 is not found in NuGet feeds https://api.nuget.org/v3/index.json;https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json.)

Any suggestions?

I don't know why it's even trying to install the ios workload, since I only have an android project in my solution.