xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.63k stars 1.88k forks source link

[Bug] App becomes unresponsive and output shows Native Crash Reporting when navigating back using SfButtons in iOS #15418

Open neoversi opened 2 years ago

neoversi commented 2 years ago

Description

In my test app when navigating between two pages going back from a page that has an SfButton or SfBorder from syncfusion will cause the app to become unresponsive and generate a Native Crash Reporting error in the output window like so:

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

Got a segv 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:

0x10ffc50d5 - /Users/dssham/Library/Developer/CoreSimulator/Devices/5E66EDCC-D588-48CC-BBC2-1F71091F0ACA/data/Containers/Bundle/Application/BE0A48B4-3228-4800-8969-202CD0271017/XamarinNavigationTest.iOS.app/XamarinNavigationTest.iOS : mono_dump_native_crash_info
0x10ffb9bce - /Users/dssham/Library/Developer/CoreSimulator/Devices/5E66EDCC-D588-48CC-BBC2-1F71091F0ACA/data/Containers/Bundle/Application/BE0A48B4-3228-4800-8969-202CD0271017/XamarinNavigationTest.iOS.app/XamarinNavigationTest.iOS : mono_handle_native_crash
0x10ffcba09 - /Users/dssham/Library/Developer/CoreSimulator/Devices/5E66EDCC-D588-48CC-BBC2-1F71091F0ACA/data/Containers/Bundle/Application/BE0A48B4-3228-4800-8969-202CD0271017/XamarinNavigationTest.iOS.app/XamarinNavigationTest.iOS : mono_sigsegv_signal_handler_debug
0x7fff6fafbdfd - /usr/lib/system/libsystem_platform.dylib : _sigtramp
0x60000106eac0 - Unknown
0x116eeae6a - Unknown

================================================================= Basic Fault Address Reporting

Memory around native instruction pointer (0x7fff2018564a):0x7fff2018563a 00 00 00 00 00 90 4c 8b 57 08 48 8b 3f 49 89 f3 ......L.W.H.?I.. 0x7fff2018564a 45 23 5a 18 49 c1 e3 04 4d 03 5a 10 49 3b 33 75 E#Z.I...M.Z.I;3u 0x7fff2018565a 0a 4d 8b 5b 08 4d 31 d3 41 ff e3 49 83 3b 01 76 .M.[.M1.A..I.;.v 0x7fff2018566a 13 49 83 c3 10 49 3b 33 75 f1 4d 8b 5b 08 4d 31 .I...I;3u.M.[.M1

================================================================= Managed Stacktrace:

  at <unknown> <0xffffffff>
  at ObjCRuntime.Messaging:IntPtr_objc_msgSendSuper <0x000e9>
  at UIKit.UIColor:get_CGColor <0x001da>
  at CoreFoundation.NativeObject:Dispose <0x00074>
  at Syncfusi

on.XForms.iOS.Border.SfBorderRenderer:Dispose <0x0055a> at Syncfusion.XForms.iOS.Buttons.SfButtonRenderer:Dispose <0x0007a> at Foundation.NSObject:Dispose <0x00074> at Xamarin.Forms.Platform.iOS.VisualElementPackager:Dispose <0x002c5> at Xamarin.Forms.Platform.iOS.VisualElementPackager:Dispose <0x00071> at Xamarin.Forms.Platform.iOS.VisualElementRenderer1:Dispose <0x0024a> at Foundation.NSObject:Dispose <0x00074> at Xamarin.Forms.Platform.iOS.DisposeHelpers:DisposeModalAndChildRenderers <0x0030f> at Xamarin.Forms.Platform.iOS.Platform:HandleChildRemoved <0x000d2> at Xamarin.Forms.Element:OnDescendantRemoved <0x00120> at Xamarin.Forms.Element:OnChildRemoved <0x001c2> at Xamarin.Forms.VisualElement:OnChildRemoved <0x0009a> at Xamarin.Forms.Page:InternalChildrenOnCollectionChanged <0x003c2> at System.Collections.ObjectModel.ObservableCollection1:OnCollectionChanged <0x000fa> at System.Collections.ObjectModel.ObservableCollection1:OnCollectionChanged <0x00103> at Sy stem.Collections.ObjectModel.ObservableCollection1:RemoveItem <0x0018a> at System.Collections.ObjectModel.Collection1:Remove <0x001e5> at <Xamarin-Forms-INavigationPageController-RemoveAsyncInner>d__79:MoveNext <0x006d2> at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:Start <0x00222> at Xamarin.Forms.NavigationPage:Xamarin.Forms.INavigationPageController.RemoveAsyncInner <0x001b2> at d78:MoveNext <0x0035f> at System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start <0x001fa> at Xamarin.Forms.Platform.iOS.NavigationRenderer:UpdateFormsInnerNavigation <0x0016a> at d45:MoveNext <0x001c2> at System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start <0x0020a> at ParentingViewController:DidMoveToParentViewController <0x00182> at :runtime_invoke_void__this___object <0x001ab> at <0xffffffff> at UIKit.UIApplication:UIApplicationMain <0x00254> at UIKit.UIApplication:Main <0x001 72> at XamarinNavigationTest.iOS.Application:Main <0x00092> at :runtime_invoke_void_object <0x00198>

Issue only occurs on iOS, android version works like normal

Steps to Reproduce

  1. Tap on the button to go to second page
  2. Tap back on the second page to return to the first page
  3. App becomes unresponsive and the error appears in the output window

Expected Behavior

User should be able to navigate freely between the two pages

Actual Behavior

When going back to the first page user is unable to do anything but closethe app

Basic Information

MainPage.xaml

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="XamarinNavigationTest.MainPage"
             xmlns:local="clr-namespace:XamarinNavigationTest.ViewModel"
             xmlns:buttons="clr-namespace:Syncfusion.XForms.Buttons;assembly=Syncfusion.Buttons.XForms"
            >
    <ContentPage.BindingContext>
        <local:MainVM/>
    </ContentPage.BindingContext>

    <ContentPage.Content>
        <StackLayout Padding="20">
            <buttons:SfButton Text="To second page" Command="{Binding ToSecondPage}" TextColor="Red" BorderColor="Black"  HeightRequest="40"  VerticalOptions="CenterAndExpand" 
                HorizontalOptions="CenterAndExpand" CornerRadius="5"/>
        </StackLayout>
    </ContentPage.Content>

</ContentPage>

MainVM

 class MainVM
    {
        public MainVM()
        {
            ToSecondPage = new Command(ToSecondPageClicekd);

        }

        public Command ToSecondPage { get; set; }
        public async void ToSecondPageClicekd()
        {
            await Application.Current.MainPage.Navigation.PushAsync(new SecondPage());
        }
    }

SecondPage.xaml

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="XamarinNavigationTest.Views.SecondPage"
             xmlns:local="clr-namespace:XamarinNavigationTest.ViewModel"
             xmlns:buttons="clr-namespace:Syncfusion.XForms.Buttons;assembly=Syncfusion.Buttons.XForms"
             >
    <ContentPage.BindingContext>
        <local:SecondVM/>
    </ContentPage.BindingContext>

    <ContentPage.Content>

            <!--<Button Text="To third page" Command="{Binding ToThirdPage}" TextColor="Red" HeightRequest="40"  VerticalOptions="CenterAndExpand" 
                HorizontalOptions="CenterAndExpand"/>-->
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

SecondPageVM

 class SecondVM
    {
       public SecondVM()
        {
            ToThirdPage = new Command(ToThirdPageClicekd);
        }
        public Command ToThirdPage { get; set; }
        public async void ToThirdPageClicekd()
        {
            await Application.Current.MainPage.Navigation.PushAsync(new ThirdPage());
        }
    }

Environment

Show/Hide Visual Studio info ``` Microsoft Visual Studio Community 2019 Version 16.11.5 VisualStudio.16.Release/16.11.5+31729.503 Microsoft .NET Framework Version 4.8.04084 Installed Version: Community ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools ASA Service Provider 1.0 ASP.NET and Web Tools 2019 16.11.75.64347 ASP.NET and Web Tools 2019 ASP.NET Web Frameworks and Tools 2019 16.11.75.64347 For additional information, visit https://www.asp.net/ Azure App Service Tools v3.0.0 16.11.75.64347 Azure App Service Tools v3.0.0 Azure Data Lake Node 1.0 This package contains the Data Lake integration nodes for Server Explorer. Azure Data Lake Tools for Visual Studio 2.6.1000.0 Microsoft Azure Data Lake Tools for Visual Studio Azure Functions and Web Jobs Tools 16.11.75.64347 Azure Functions and Web Jobs Tools Azure Stream Analytics Tools for Visual Studio 2.6.1000.0 Microsoft Azure Stream Analytics Tools for Visual Studio C# Tools 3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools. Extensibility Message Bus 1.2.6 (master@34d6af2) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration. Fabric.DiagnosticEvents 1.0 Fabric Diagnostic Events IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info JustDecompilePackage2017 Extension 1.0 JustDecompilePackage2017 Visual Studio Extension Detailed Info Microsoft Azure HDInsight Azure Node 2.6.1000.0 HDInsight Node under Azure Node Microsoft Azure Hive Query Language Service 2.6.1000.0 Language service for Hive query Microsoft Azure Service Fabric Tools for Visual Studio 16.10 Microsoft Azure Service Fabric Tools for Visual Studio Microsoft Azure Stream Analytics Language Service 2.6.1000.0 Language service for Azure Stream Analytics Microsoft Azure Stream Analytics Node 1.0 Azure Stream Analytics Node under Azure Node Microsoft Azure Tools for Visual Studio 2.9 Support for Azure Cloud Services projects Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE. Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Microsoft Library Manager 2.1.113+g422d40002e.RR Install client-side libraries easily to any web project Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers Microsoft Visual Studio Tools for Containers 1.2 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container. Mono Debugging for Visual Studio 16.10.15 (552afdf) Support for debugging Mono processes with Visual Studio. NuGet Package Manager 5.11.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/ ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info Razor (ASP.NET Core) 16.1.0.2122504+13c05c96ea6bdbe550bd88b0bf6cdddf8cde1725 Provides languages services for ASP.NET Core Razor. SQL Server Data Tools 16.0.62107.28140 Microsoft SQL Server Data Tools SyncfusionXamarinMenu Extension 1.0 SyncfusionXamarinMenu Visual Studio Extension Detailed Info ToolWindowHostedEditor 1.0 Hosting json editor into a tool window TypeScript Tools 16.0.30526.2002 TypeScript Tools for Microsoft Visual Studio Visual Basic Tools 3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Visual F# Tools 16.11.0-beta.21322.6+488cc578cafcd261d90d748d8aaa7b8b091232dc Microsoft Visual F# Tools Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio Visual Studio Container Tools Extensions 1.0 View, manage, and diagnose containers within Visual Studio. Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers Visual Studio Tools for Kubernetes 1.0 Visual Studio Tools for Kubernetes VisualStudio.DeviceLog 1.0 Information about my package VisualStudio.Foo 1.0 Information about my package VisualStudio.Mac 1.0 Mac Extension for Visual Studio Xamarin 16.11.000.190 (d16-11@2391ed9) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android. Xamarin Designer 16.11.0.17 (remotes/origin/11e0001f0b17269345e80b58fb3adf1ba4efe2cd@11e0001f0) Visual Studio extension to enable Xamarin Designer tools in Visual Studio. Xamarin Templates 16.10.5 (355b57a) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms. Xamarin.Android SDK 11.4.0.5 (d16-11/7776c9f) Xamarin.Android Reference Assemblies and MSBuild support. Mono: c633fe9 Java.Interop: xamarin/java.interop/d16-11@48766c0 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.35.4@85460d3 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-11@683f375 Xamarin.iOS and Xamarin.Mac SDK 15.0.0.8 (0796d78dc) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support. ```

Build Logs

Screenshots

Reproduction Link

https://github.com/neoversi/XamarinNavigationTest

Workaround

jfversluis commented 2 years ago

Have you raised the issue with SyncFusion? Does it work when you use a regular Xamarin.Forms button?

ahoke-cr commented 2 years ago

As Gerald said, you should raise any issues related to Syncfusion views on their [support forums[(https://www.syncfusion.com/forums/). The Xamarin team cannot fix issues with Syncfusion views.