Why Does Visual Studio 2019 for Mac Crash My App Suddenly?

AllanChin.6924AllanChin.6924 USUniversity ✭✭✭

Since upgrading to Visual Studio 2019 with Xamarin.Mac 5.6.0.2, our app now crashes fairly regularly in different areas of our code and on Mojave 10.14 only. And, this happens with our Jenkins production builds as well as during development debugging. But again, on 10.14 only. This issue is so bad, we're having to downgrade our dev environment just so QA can continue testing. The crash detail is always the same.

Application Specific Information:
*** Terminating app due to uncaught exception 'NSGenericException', reason: 'The window has been marked as needing another Layout Window pass, but it has already had more Layout Window passes than there are views in the window.'
abort() called
terminating with uncaught exception of type NSException

I've attached the full crash dump.

Has anybody else run into this problem and have solved it? Does anybody have any idea what we must be doing to offend 10.14 this way?

Thanks

Here's my environment.

=== Visual Studio Enterprise 2019 for Mac ===

Version 8.0.6 (build 4)
Installation UUID: c6d36724-b00e-45a8-bd5f-ae9c1d10178f
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.6.0.2 (d16-0 / 040682909)

            Package version: 518010003

=== Mono Framework MDK ===

Runtime:
Mono 5.18.1.3 (2018-08/fdb26b0a445) (64-bit)
Package version: 518010003

=== NuGet ===

Version: 4.8.2.5835

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.1.9
2.1.8
2.1.7
2.1.2
2.0.5
SDK: /usr/local/share/dotnet/sdk/2.1.505/Sdks
SDK Versions:
2.1.505
2.1.504
2.1.503
2.1.302
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.9
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 10.2.1 (14490.122)
Build 10E1001

=== Xamarin.Android ===

Version: 9.2.3.0 (Visual Studio Enterprise)
Android SDK: /Users/jit/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
6.0 (API level 23)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.0
SDK Build Tools Version: 27.0.3

Build Information:
Mono: mono/mono/[email protected]
Java.Interop: xamarin/java.interop/[email protected]
LibZipSharp: grendello/LibZipSharp/[email protected]
LibZip: nih-at/libzip/[email protected]
MXE: xamarin/mxe/[email protected]
ProGuard: xamarin/proguard/[email protected]
SQLite: xamarin/sqlite/[email protected]
Xamarin.Android Tools: xamarin/xamarin-android-tools/[email protected]

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/jit/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 Device Manager ===

Version: 1.2.0.14
Hash: 86df26f
Branch: remotes/origin/d16-0
Build date: 2019-04-05 16:58:56 UTC

=== Xamarin.Mac ===

Version: 5.8.0.0 (Visual Studio Enterprise)
Hash: 0aa84521
Branch: d16-0
Build date: 2019-04-02 16:01:19-0400

=== Xamarin.iOS ===

Version: 12.8.0.2 (Visual Studio Enterprise)
Hash: f2248ae6
Branch: d16-0
Build date: 2019-04-23 11:59:04-0400

=== Xamarin Designer ===

Version: 4.17.4.418
Hash: 3d086e814
Branch: remotes/origin/d16-0
Build date: 2019-04-01 09:20:10 UTC

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 800060004
Git revision: 889a91b9b9d44b10ef4d1bc5eb3cfb46ecf992c1
Build date: 2019-05-07 17:06:59+00
Build branch: release-8.0
Xamarin extensions: 3b90188697a1755849b0d7d322d2651033204242

=== Operating System ===

Mac OS X 10.14.4
Darwin 18.5.0 Darwin Kernel Version 18.5.0
Mon Mar 11 20:40:32 PDT 2019
root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64

Answers

  • AllanChin.6924AllanChin.6924 USUniversity ✭✭✭

    Here is an additional data point...

    We downgraded just Xamarin.Mac from 5.6.0.2 to 5.2.1.2 (pre-release with ImageCaptureCore bindings) and the crashes went away. Previously, we downgraded Xcode but that didn't solve the problem.

    On doc.microsoft.com, there appears to be 5.8 and 5.10 releases. But, Visual Studio does not discover those as updates.

    It definitely appears that Xamarin.Mac is culpable here.

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    Hmm, a few things:

    • It looks like it's an ObjC crash under the hood: NSGenericException
    • It might be due to a XM bug or we could have changed some timing or call order that exposes an existing crash.
    • Without a sample showing the problem, it will be difficult to pin down. Have you been able to isolate this issue at all?
    • The crash stack has a number of JIT frames, consider AOT'ing your application to get more details on those.
  • AllanChin.6924AllanChin.6924 USUniversity ✭✭✭

    Another data point...

    It seems that Xamarin.Mac 5.8 is now available has an update on Mojave. Possible because our dev updated Xcode 10.2 to 10.2.1. In this configuration, the crashes appear to have been fixed. We have not configured our Jenkins builds this way yet.

    Meanwhile on my 10.12, Xcode 9.2, Xamarin.Mac 5.8 is NOT available as an update.

    It seems that different combinations on Xamarin.Mac/Xcode are allowed on different dev machines depending on the MacOS version. Is this sure? Does this make sense.

    Did Xamarin.Mac 5.8 explicitly address the crash issues we've been seeing?

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    Are you certain both machines are on the same channel in the updater?

    • 5.8.0.0 is latest in stable
    • 5.10.0.150 is latest in Alpha\Beta
  • AllanChin.6924AllanChin.6924 USUniversity ✭✭✭

    MacOS 10.12.6, Xcode 9.2, Xamarin.Mac 5.6.0.2. 5.8.0.0 is not available to me.

    === Visual Studio Community 2019 for Mac ===

    Version 8.0.7 (build 3)
    Installation UUID: 52841cf1-dbf0-469c-a714-a263f1d0573b
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 5.6.0.2 (d16-0 / 040682909)

    Package version: 518010003
    

    === Mono Framework MDK ===

    Runtime:
    Mono 5.18.1.3 (2018-08/fdb26b0a445) (64-bit)
    Package version: 518010003

    === NuGet ===

    Version: 4.8.2.5835

    === .NET Core ===

    Runtime: /usr/local/share/dotnet/dotnet
    Runtime Versions:
    2.1.9
    2.0.5
    2.0.0
    SDK: /usr/local/share/dotnet/sdk/2.1.505/Sdks
    SDK Versions:
    2.1.505
    2.1.4
    2.0.0
    MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Sdks

    === Xamarin.Profiler ===

    Version: 1.6.9
    Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

    === Updater ===

    Version: 11

    === Xamarin.Android ===

    Version: 9.2.3.0 (Visual Studio Community)
    Android SDK: /Users/allan/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
    6.0 (API level 23)
    7.1 (API level 25)
    8.1 (API level 27)

    SDK Tools Version: 25.2.5
    SDK Platform Tools Version: 26.0.0
    SDK Build Tools Version: 25.0.3

    Build Information:
    Mono: mono/mono/[email protected]
    Java.Interop: xamarin/java.interop/[email protected]
    LibZipSharp: grendello/LibZipSharp/[email protected]
    LibZip: nih-at/libzip/[email protected]
    MXE: xamarin/mxe/[email protected]
    ProGuard: xamarin/proguard/[email protected]
    SQLite: xamarin/sqlite/[email protected]
    Xamarin.Android Tools: xamarin/xamarin-android-tools/[email protected]

    === Microsoft Mobile OpenJDK ===

    Java SDK: /Users/allan/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 Device Manager ===

    Version: 1.2.0.14
    Hash: 86df26f
    Branch: remotes/origin/d16-0
    Build date: 2019-05-16 16:08:28 UTC

    === Apple Developer Tools ===

    Xcode 9.2 (13772)
    Build 9C40b

    === Xamarin.Mac ===

    Version: 5.8.0.0 (Visual Studio Community)
    Hash: 0aa84521
    Branch: d16-0
    Build date: 2019-04-02 16:01:19-0400

    === Xamarin.iOS ===

    Version: 12.8.0.2 (Visual Studio Community)
    Hash: f2248ae6
    Branch: d16-0
    Build date: 2019-04-23 11:59:04-0400

    === Xamarin Designer ===

    Version: 4.17.4.418
    Hash: 3d086e814
    Branch: remotes/origin/d16-0
    Build date: 2019-04-01 09:20:10 UTC

    === Xamarin Inspector ===

    Version: 1.4.3
    Hash: db27525
    Branch: 1.4-release
    Build date: Mon, 09 Jul 2018 21:20:18 GMT
    Client compatibility: 1

    === Build Information ===

    Release ID: 800070003
    Git revision: 249c1092cf2a8264e6f0d1cbacd5f23b9a3b6dcc
    Build date: 2019-05-20 17:07:22+00
    Build branch: release-8.0
    Xamarin extensions: e2fe31d63a4522ed7c7c099980656d468e7465ba

    === Operating System ===

    Mac OS X 10.12.6
    Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Wed Apr 24 20:50:53 PDT 2019
    root:xnu-3789.73.49~1/RELEASE_X86_64 x86_64

  • AllanChin.6924AllanChin.6924 USUniversity ✭✭✭

    BTW, it appears updating our Jenkins' Xamarin.Mac version to 5.8.0.0. did not solve the crashing issue :'( .

    And Xcode 10.2 requires 10.14 or later.

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    It looks like we aren't showing updates that require Xcode 10.2, which as you noted needs macOS 10.14.4. Strongly consider upgrading to 10.14.4.

    As I said before, without a concrete test case I can't note if future macOS update will fix your issue or note, or even if it's a Xamarin.Mac bug as before.

    Updating your SDK and Xcode versions can expose timing issues and API mistake that were wrong before but not noticed or hit.

    Given previous issues with threading and modal dialogs, I'm curious if you are hitting a new assert in AppKit caused by behavior already existing in your application.

    Isolating a small sample application will be very helpful in determining where the fault lies.

Sign In or Register to comment.