Open whitneyschmidt opened 4 years ago
From @Tragetaschen on Tue, 02 Jun 2020 14:28:10 GMT
Also frequently, when the assertion hits, the Visual Studio instance hard-locks and I have to kill it through Task Manager.
Out of curiosity: In other projects, I have seen issues being transferred "inline", so it just changed the project it's visible in. This here is a verbatim copy (with changed authorship). Is this due to the issue being moved from one org to another?
@Tragetaschen Yep, that's exactly what's happening :)
We'd be able to reassign it without the copy/paste if we were moving to another repo inside of xamarin, but mono/mono is a completely separate repo so we create a new issue and c/p the issue history.
Your issue was transferred because it looks like a mono runtime issue, not an SDK issue with Xamarin.iOS or Xamarin.Mac.
any progress on this issue? i'm still experiencing this crash which makes debugging an iOS project impossible. Do you need more info?
cc @vargaz for visibility.
One bit of info that wasn't copied from the original issue filed in x-ios: It looks like this line is getting hit: https://github.com/mono/mono/blob/87ef5557017a8d822ae31587846a54fcd66daf1b/mono/mini/mini-arm64.c#L5439
Can somebody at ms able to reproduce this ?
@nor0x Could you upload a small sample solution that reproduces this issue and share where exactly you're setting breakpoints?
It also looks like you're using VSWin + VSMac, could you share the version information for both?
I wasn't able to reproduce this using VSMac + an iOS device.
@whitneyschmidt i will prepare a fresh project with a repro and will share it with you. For the record i'm seeing this issue on an iPhone 5S with iOS 12.4.8 installed. Here is my info from VSMac
=== Visual Studio Community 2019 for Mac ===
Version 8.7.3 (build 13)
Installation UUID: 095fb574-1e9d-4d96-970e-dc7f3a099470
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)
Package version: 612000090
=== Mono Framework MDK ===
Runtime:
Mono 6.12.0.90 (2020-02/d3daacdaa80) (64-bit)
Package version: 612000090
=== Roslyn (Language Service) ===
3.7.0-6.20375.2+34202cc2f3e869fd70a26d8237f4552cf9e192cf
=== NuGet ===
Version: 5.7.0.6702
=== .NET Core SDK ===
SDK: /usr/local/share/dotnet/sdk/3.1.401/Sdks
SDK Versions:
3.1.401
3.1.302
3.1.301
3.1.300
3.1.202
3.1.200
3.1.102
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/Sdks
=== .NET Core Runtime ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.1.7
2.1.21
=== Xamarin.Profiler ===
Version: 1.6.13.11
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Apple Developer Tools ===
Xcode 11.6 (16141)
Build 11E708
=== Xamarin.Mac ===
Version: 6.20.2.2 (Visual Studio Community)
Hash: 817b6f72a
Branch: d16-7
Build date: 2020-07-18 18:44:59-0400
=== Xamarin Designer ===
Version: 16.7.0.492
Hash: f5afe667d
Branch: remotes/origin/d16-7-vsmac
Build date: 2020-07-10 18:42:54 UTC
=== Xamarin.iOS ===
Version: 13.20.2.2 (Visual Studio Community)
Hash: 817b6f72a
Branch: d16-7
Build date: 2020-07-18 18:45:00-0400
=== Xamarin.Android ===
Version: 11.0.2.0 (Visual Studio Community)
Commit: xamarin-android/d16-7/025fde9
Android SDK: /MYUSER/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.1
SDK Build Tools Version: 27.0.3
Build Information:
Mono: 83105ba
Java.Interop: xamarin/java.interop/d16-7@1f3388a
ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
SQLite: xamarin/sqlite/3.32.1@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-7@017078f
=== Microsoft OpenJDK for Mobile ===
Java SDK: /MYUSER/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android SDK Manager ===
Version: 16.7.0.13
Hash: 8380518
Branch: remotes/origin/d16-7~2
Build date: 2020-08-13 18:19:24 UTC
=== Android Device Manager ===
Version: 16.7.0.22
Hash: 576004d
Branch: remotes/origin/d16-7
Build date: 2020-08-13 18:19:46 UTC
=== Build Information ===
Release ID: 807030013
Git revision: 793cad2e5999f9797bc6bc71759f31e97f57d94a
Build date: 2020-08-13 12:22:13-04
Build branch: release-8.7
Xamarin extensions: 793cad2e5999f9797bc6bc71759f31e97f57d94a
=== Operating System ===
Mac OS X 10.15.6
Darwin 19.6.0 Darwin Kernel Version 19.6.0
Thu Jun 18 20:49:00 PDT 2020
root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64
We have a VSMac bug hitting this: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1231042
Resolved pending breakpoint at 'LoginVM.cs:85,1' to void MillionAndUp.ViewModels.LoginVM.<_doLogin>d__21.MoveNext () [0x000bf].
2020-09-29 15:38:13.589 App.iOS[2772:1005358] XPC connection interrupted
Thread finished: <Thread Pool> #13
2020-09-29 15:38:30.970 App.iOS[2772:1005364] error: * Assertion at /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mono/mini/mini-arm64.c:5439, condition `native_offset % 4 == 0' not met
=================================================================
Native Crash Reporting
=================================================================
Got a abrt 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:
=================================================================
0x105720104 - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : mono_dump_native_crash_info
0x10571637c - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : mono_handle_native_crash
0x10571f650 - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : sigabrt_signal_handler
0x1bdbc9414 - /usr/lib/system/libsystem_platform.dylib : <redacted>
0x1bdbcc948 - /usr/lib/system/libsystem_pthread.dylib : pthread_kill
0x1bdb5bba4 - /usr/lib/system/libsystem_c.dylib : abort
0x1058de71c - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : _ZL12log_callbackPKcS0_S0_iPv
0x1058a9c4c - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : monoeg_g_logv_nofree
0x1058a9ce0 - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : monoeg_assertion_message
0x1058a9d24 - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : mono_assertion_message_unreachable
0x105710de8 - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : mono_arch_set_breakpoint
0x10574a6cc - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : insert_breakpoint
0x10574aaac - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : mono_de_set_breakpoint
0x10574ce18 - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : ss_bp_add_one
0x10574be64 - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : mono_de_ss_start
0x10574c944 - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : mono_de_ss_create
0x10573f2c8 - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : debugger_thread
0x105831b98 - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : start_wrapper_internal
0x105831a1c - /private/var/containers/Bundle/Application/23B0457C-D67A-4093-9101-7A5B10F5651D/App.iOS.app/App.iOS : start_wrapper
0x1bdbcb914 - /usr/lib/system/libsystem_pthread.dylib : _pthread_start
0x1bdbd39d4 - /usr/lib/system/libsystem_pthread.dylib : thread_start
Any updates on this issue as yet, I've also experienced it recently
Hey @Cliffy786 - There are no updates as we've been unable to reproduce this issue locally (so we can debug and fix it).
If you have interest in resolving this, please create a small sample application that reproduces it and attach it here.
I have the same error and crash with VS 16.8.3 together with VS for MAC 8.8.3 and Xcode 12.2. iPhone with iOS 14.2.
Thanks for reporting this issue @omghb.
If it's possible, could you create a small sample application that reproduces the problem and upload it here? That is the best way for the team to investigate.
cc @dalexsoto @rolfbjarne for visibility.
I tried to create a small sample app. Unfortunately, I was not able to reproduce this issue with it.
I have seen the issue when I set the breakpoint within a constructor of a class which is instantiated via AutoFac within the AppDelegate.FinishedLaunching(UIApplication app, NSDictionary options)
method. Breakpoints at other places work correct.
I'm having the same issue here. My project works on emulator but not on physical device. Are there any updates?
error: * Assertion at /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mono/mini/mini-arm64.c:5439, condition
native_offset % 4 == 0' not met
Step request failed: Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.`
Visual Studio Community 2019 for Mac Version 8.8.3 (build 16) Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)
What worked for me was disabling "Enable the Mono interpreter" in the project options -> iOS Build
What worked for me was disabling "Enable the Mono interpreter" in the project options -> iOS Build
This!
Having the same issue today with latest version of all tools. disabling the Mono interpreter fixed it.
@alanspires You are correct, it does fix the issue - but opens another (minor, since it is not a crash): The XAML HotReload in Visual Studio stops working when using Xamarin.iOS. Is there any known workarounds for that?
Thanks, disabling "Enable the Mono interpreter" worked. Hot reload does not work now, it's at least something.
This saved me after hours of troubleshooting. Disabling the Mono Interpreter solves the problem, but also removing all breakpoints and then adding a few back works, too. Ultimately there's an issue with Hot Reload as that crashes randomly even with Mono Interpreter enabled.
Hi there, we are working on a very complex project and now we are facing the same issue. Disabling the mono interpreter fixed the problem, not a real solution tho.
Microsoft Visual Studio Professional 2019 Version 16.11.2 Xamarin 16.11.000.174 (d16-11@e8f56f1) Xamarin.iOS and Xamarin.Mac SDK 14.20.0.25 (3b53e529b)
I have the same problem. The app crashes while debugging, but works fine when just running it. Disabling the mono interpreter now allows me to debug, but hot reload no longer works.
@whitneyschmidt @dalexsoto @rolfbjarne if you guys want to reproduce the issue, then include a native C library in xamarin ios project (libX,iOS.a) and then call one of its functions (P/Invoke) using System.Runtime.InteropServices, e.g.:
[DllImport("__Internal", EntryPoint = "interpret_scan_data_buffer")] public static extern int DeserialiseScanDataIos(byte[] buffer, int bufferSize, ref NativeScanData scanData);
Seems like I can either use hot reload, or call native C functions, but not both.
What worked for me was disabling "Enable the Mono interpreter" in the project options -> iOS Build
I have a few dynamic type resolves in my code and disabling this is not an option for me (since iOS doesn't support JIT)
The problem still persists, just the line number has changed. The error is now:
error: * Assertion at /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mono/mini/mini-arm64.c:5447, condition `native_offset % 4 == 0' not met
My breakpoint is in a XF solution in the iOS project.
The app crashes when the breakpoint is hit.
This is VS2022, version 17.7.0 Preview 2.0 on Windows and 17.6 Preview (Build 1539) and Xamarin.iOS 16.4.0.5 on the Mac.
Maybe the issue text should be "App crashes when resolving a breakpoint" instead.
When I disable the Mono Interpreter, then it works.
Are we really still running on a Mono version from 2020 like the path suggests? Cause in the current version that assert is in line 5491 and the file mini-arm64.c was last changed two years ago. Why isn't that updated?
xamarin-ios 16.4.0.6 (latest shipping in vs 2022 at tow) is built against 6.12.0.179, which is from May of 2022 but built off of the 2020-02 branch.
Repro app: XMI8731_M19899.zip
Great @LeadAssimilator ! Finally somebody managed to write a repro! I can reproduce it at once with the steps you provided.
any leads on this?
Have you been able to reproduce this @BrzVlad with the provided sample?
Any progress on this. This bug stops us from debugging Xamarin iOS projects. The result is a crash.
Please let me know if I can provide you another sample project to help fix this.
Is this issue reproducible in the latest dotnet (7/8) ? There isn't much focus on legacy mono.
Thanks for the update.
I don't know as Xamarin uses .Net Standard. If it can't be fixed is there a work around?
From @Tragetaschen on Tue, 02 Jun 2020 14:10:49 GMT
Steps to Reproduce
I have a couple of view model constructors where, when I set a break point on the line with the closing curly brace, the process on the iPhone hits an assertion and crashes. So far, I have not identified anything special about the constructor or last instruction—for example, there is one that just sets five
ICommand
properties. Some break points on the closing brace trigger it, some don't.Expected Behavior
No crash
Actual Behavior
Environment
Copied from original issue xamarin/xamarin-macios#8731