Xamarin.forms: macOS: Switching Detail pages in MasterDetailPage causes app crash

Created on 5 Nov 2018  路  6Comments  路  Source: xamarin/Xamarin.Forms

Description

Switching Detail Page in my Xamarin.Forms app on Mac started to crash since XF v3.3.X. Earlier it worked fine.

Steps to Reproduce

  1. Create an XF app on mac with MasterDetailPage as MainPage with several detail pages (or use my attached one ).
  2. Launch it and try to switch detail pages.

Expected Behavior

Pages are expected to be switched.

Actual Behavior

Crash

Basic Information

  • Version with issue: 3.3.0.967583 (also crashes on the previous 3.3.0.x version)
  • Last known good version: 3.2.0.871581
  • IDE: MS VS 2017 for Mac
  • Platform Target Frameworks:
    macOS: Xamarin.Mac Version: 5.0.0.0 (Visual Studio Community)

  • Nuget Packages:
    NetStandrard 2.0.3
    Xamarin.Forms v3.3.0.967583

  • Affected Devices:
    Can assume all mac devices

Screenshots

2018-11-05 08:56:28.526 TestXF[47682:380240] View has 1 views pointing at it that can't be found.
Stacktrace:

at <0xffffffff>
at (wrapper managed-to-native) AppKit.NSApplication.NSApplicationMain (int,string[]) [0x0005a] in :0
at AppKit.NSApplication.Main (string[]) [0x00040] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.0.0.0/src/Xamarin.Mac/AppKit/NSApplication.cs:100
at TestXF.MainClass.Main (string[]) [0x00017] in /Users/slavak/work/test/TestXF/TestXF.Mac/Main.cs:11
at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr) [0x00051] in <914ebf574a314a7bafc9eaecec035925>:0

Native stacktrace:

0 TestXF 0x00000001058096e8 mono_handle_native_crash + 264
1 TestXF 0x0000000105785f06 altstack_handle_and_restore + 70
2 libobjc.A.dylib 0x00007fff50dbce9d objc_msgSend + 29
3 AppKit 0x00007fff2711d8f5 -[NSView _removeFromKeyViewLoop] + 203
4 AppKit 0x00007fff279d28aa -[NSView _finalize] + 830
5 AppKit 0x00007fff2711d57a -[NSView dealloc] + 164
6 TestXF 0x000000010571516b xamarin_invoke_objc_method_implementation + 59
7 TestXF 0x000000010571540c xamarin_release_trampoline + 156
8 libobjc.A.dylib 0x00007fff50dc0087 _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 817
9 CoreFoundation 0x00007fff29b4ea06 _CFAutoreleasePoolPop + 22
10 Foundation 0x00007fff2bc808ad -[NSAutoreleasePool drain] + 144
11 AppKit 0x00007fff2711f8e5 -[NSApplication run] + 860
12 AppKit 0x00007fff270eea72 NSApplicationMain + 804
13 ??? 0x000000010c41d3de 0x0 + 4500607966
14 ??? 0x000000010c41d10b 0x0 + 4500607243
15 TestXF 0x000000010581ce41 mono_jit_runtime_invoke + 1441
16 TestXF 0x0000000105918a1f mono_runtime_invoke_checked + 127
17 TestXF 0x000000010591f96e mono_runtime_exec_main_checked + 110
18 TestXF 0x000000010577bf49 mono_jit_exec + 297
19 TestXF 0x000000010577ef24 mono_main + 11124
20 TestXF 0x000000010571cae9 xamarin_main + 1305
21 TestXF 0x000000010571dab4 main + 36
22 libdyld.dylib 0x00007fff519e4015 start + 1
23 ??? 0x0000000000000002 0x0 + 2

Debug info from gdb:

(lldb) command source -s 0 '/tmp/mono-gdb-commands.SBDGwx'
Executing commands in '/tmp/mono-gdb-commands.SBDGwx'.
(lldb) process attach --pid 47682
Process 47682 stopped

  • thread #1, name = 'tid_307', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00007fff51b3522a libsystem_kernel.dylib__wait4 + 10 libsystem_kernel.dylib__wait4:
    -> 0x7fff51b3522a <+10>: jae 0x7fff51b35234 ; <+20>
    0x7fff51b3522c <+12>: movq %rax, %rdi
    0x7fff51b3522f <+15>: jmp 0x7fff51b2bb0e ; cerror
    0x7fff51b35234 <+20>: retq
    Target 0: (TestXF) stopped.

Reproduction Link

TestXF.zip

3 help wanted regression macOS bug up-for-grabs

Most helpful comment

I'm facing the same issue with 3.4.x versions also i got the same crash when try to assign a new page to the MainPage of my Application class (switching from a login page to the MasterDetailPage).

All 6 comments

Similar to @chucker, between this issue and #3031 my mac app has been dead in the water for a few weeks now. I can create a MasterDetail app from template, add the Mac project to the solution, and run it, then just hit the About menu item in the main page of the generated template XAML, and it will reproduce the exact same NRE as above. Anyone with a MasterDetailPage based app is likely affected.

I'm facing the same issue with 3.4.x versions also i got the same crash when try to assign a new page to the MainPage of my Application class (switching from a login page to the MasterDetailPage).

I'm facing the same issue. This happens when changing the MainPage, Detail page of MasterDetailPage (Not every time but often) and when calling PopModalAsync().

MacOS Mojave (10,14,1), Visual Studio Mac Community, Xamarin.Forms 3.4.0

This no longer seems to be an issue with XF 3.5.169047. Probably fixed with #4156. I've tried the template example I mentioned above for recreating the issue and toggling to About on the menu now works.

Can confirm, there is no crash since 3.5.169047

I have a brand new blank app in which switching detail pages in MasterDetailPage causes the Mac application to jump up & down (by 1-2cm), it looks really bad. Before I open an issue I was just wondering if anyone else has experienced this? I am using Xamarin.Forms 4.4.0.991640. Thank you!
edit raised bug #9544

Was this page helpful?
0 / 5 - 0 ratings