Skip to content

Fix XA_BROKEN_EXCEPTION_TRANSITIONS support #4548

Open
@roubachof

Description

@roubachof

NOTE: the SIGSEGV only happens while debugging.
If in RELEASE or ran in DEBUG mode without debugging, an UNHANDLED EXCEPTION is raised, but the app doesn't crash.

I am here trying to create blur views for Xamarin.Forms, for the android implementation I chose https://github.com/mmin18/RealtimeBlurView.

I translated in C# all the classes, you can find them here:

https://github.com/roubachof/Sharpnado.Presentation.Forms/tree/secret/Sharpnado.Presentation.Forms.Droid/Renderers/MaterialFrame/RealtimeBlurView

In his java implementation, mmin18 has the following code:

https://github.com/mmin18/RealtimeBlurView/blob/master/library/src/com/github/mmin18/widget/RealtimeBlurView.java#L259-L267

For stoping the drawing process he throws a custom "STOP_EXCEPTION" in the Draw method of the blur view:

https://github.com/mmin18/RealtimeBlurView/blob/master/library/src/com/github/mmin18/widget/RealtimeBlurView.java#L321-L330

Remark: you have to interrupt the drawing of all the next children, so returning in the blur view's Draw method is not enough....

It seems to be fine in plain android since I couldn't find an issue talking about SIGSEGV and STOP_EXCEPTION in the original repo.

But in Xamarin.Android I get a sig segv exception:

Loaded assembly: System.Runtime.Serialization.dll [External]
**Sharpnado.Presentation.Forms.Droid.Renderers.MaterialFrame.RealtimeBlurView.RealtimeBlurView+StopException:** 'Exception of type 'Sharpnado.Presentation.Forms.Droid.Renderers.MaterialFrame.RealtimeBlurView.RealtimeBlurView+StopException' was thrown.'

04-13 14:29:09.259 D/Mono    ( 3665): DllImport attempting to load: '/system/lib/liblog.so'.
04-13 14:29:09.259 D/Mono    ( 3665): DllImport loaded library '/system/lib/liblog.so'.
04-13 14:29:09.260 D/Mono    ( 3665): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
04-13 14:29:09.260 D/Mono    ( 3665): Searching for '__android_log_print'.
04-13 14:29:09.260 D/Mono    ( 3665): Probing '__android_log_print'.
04-13 14:29:09.260 D/Mono    ( 3665): Found as '__android_log_print'.
04-13 14:29:09.264 I/MonoDroid( 3665): UNHANDLED EXCEPTION:
04-13 14:29:09.264 I/MonoDroid( 3665): Sharpnado.Presentation.Forms.Droid.Renderers.MaterialFrame.RealtimeBlurView.RealtimeBlurView+StopException: Exception of type 'Sharpnado.Presentation.Forms.Droid.Renderers.MaterialFrame.RealtimeBlurView.RealtimeBlurView+StopException' was thrown.
04-13 14:29:09.264 I/MonoDroid( 3665):   at Sharpnado.Presentation.Forms.Droid.Renderers.MaterialFrame.RealtimeBlurView.RealtimeBlurView.Draw (Android.Graphics.Canvas canvas) [0x0001c] in D:\Dev\Sharpnado\src\Xamarin-Forms-Practices\Sharpnado.Presentation.Forms\Sharpnado.Presentation.Forms.Droid\Renderers\MaterialFrame\RealtimeBlurView\RealtimeBlurView.cs:409 
04-13 14:29:09.264 I/MonoDroid( 3665):   at Android.Views.View.n_Draw_Landroid_graphics_Canvas_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_canvas) [0x00011] in <d3b924763d4a465c85b26f6e8edc8a53>:0 
04-13 14:29:09.264 I/MonoDroid( 3665):   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.55(intptr,intptr,intptr)
04-13 14:29:09.273 W/obile.practice( 3665): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
04-13 14:29:09.277 D/Mono    ( 3665): DllImport searching in: '__Internal' ('(null)').
04-13 14:29:09.277 D/Mono    ( 3665): Searching for 'java_interop_jnienv_throw'.
04-13 14:29:09.277 D/Mono    ( 3665): Probing 'java_interop_jnienv_throw'.
04-13 14:29:09.277 D/Mono    ( 3665): Found as 'java_interop_jnienv_throw'.
[0:] 04-13 14:29:09.278 | SharpnadoInternals | 1 | INFO | Stop exception received: rendering was stopped

=================================================================
	Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

No native Android stacktrace (see debuggerd output).

=================================================================
	Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0xe566e21b):
0xe566e20b  83 ec 0c 57 e8 2c bf fd ff 83 c4 10 89 c6 b1 01  ...W.,..........
0xe566e21b  83 7e 0c ff 74 1e 8b 07 83 ec 04 ff 77 30 56 57  .~..t.......w0VW
0xe566e22b  ff 50 0c b1 01 83 c4 10 83 f8 01 74 07 83 f8 02  .P.........t....
0xe566e23b  75 19 31 c9 8b 44 24 04 8b 00 3b 44 24 18 0f 85  u.1..D$...;D$...

=================================================================
	Managed Stacktrace:
=================================================================
	  at <unknown> <0xffffffff>
	  at Java.Interop.NativeMethods:java_interop_jnienv_get_method_id <0x00015>
	  at InstanceMethods:GetMethodID <0x0020f>
	  at Java.Interop.JniType:GetInstanceMethod <0x00097>
	  at JniInstanceMethods:GetMethodInfo <0x001ab>
	  at JniInstanceMethods:InvokeVirtualVoidMethod <0x000ef>
	  at Android.Graphics.Canvas:RestoreToCount <0x00137>
	  at PreDrawListener:OnPreDraw <0x00875>
	  at IOnPreDrawListenerInvoker:n_OnPreDraw <0x0008e>
	  at Android.Runtime.DynamicMethodNameCounter:53 <0x000a7>
	  at Android.Runtime.DynamicMetho
dNameCounter:53 <0x000af>
=================================================================
04-13 14:29:09.297 F/libc    ( 3665): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x80000c in tid 3665 (obile.practices), pid 3665 (obile.practices)

Steps to Reproduce

  1. Clone https://github.com/roubachof/Xamarin-Forms-Practices
  2. Select the "secret" branch
  3. Select DebugInfinite configuration
  4. Debug on android emulator

Expected Behavior

No SIGSEV should be raised

Actual Behavior

Version Information

Microsoft Visual Studio Community 2019
Version 16.5.2
VisualStudio.16.Release/16.5.2+29926.136
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Community

Visual C++ 2019 00435-60000-00000-AA963
Microsoft Visual C++ 2019

ASP.NET and Web Tools 2019 16.5.236.49856
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019 16.5.236.49856
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.5.236.49856
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 16.5.236.49856
Azure Functions and Web Jobs Tools

C# Tools 3.5.0-beta4-20153-05+20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e
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.0 (d16-2@8b56e20)
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

JetBrains ReSharper Ultimate 2019.3.4 Build 193.0.20200226.112949
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2020 JetBrains, Inc.

Microsoft Azure Service Fabric Tools for Visual Studio 16.0
Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30207.1

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.25+gdacdb9b7a1
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 C++ Wizards 1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers 1.1
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.

Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio 16.5.514 (c4f36a9)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 5.5.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

ResXManager 1.40.3444.0
Manage localization of all ResX-Based resources in one place. Shows all resources of a solution and let's you edit the strings and their localizations in a well-arranged data grid.

SettingsWindow Extension 1.0
SettingsWindow Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.62003.05170
Microsoft SQL Server Data Tools

StylerPackage Extension 1.0
StylerPackage Visual Stuido Extension Detailed Info

TypeScript Tools 16.0.20225.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.5.0-beta4-20153-05+20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e
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 10.8.0.0 for F# 4.7 16.5.0-beta.20104.8+7c4de19faf36647c1ef700e655a52350840c6f03
Microsoft Visual F# Tools 10.8.0.0 for F# 4.7

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 (Preview) 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.Mac 1.0
Mac Extension for Visual Studio

Xamarin 16.5.000.528 (d16-5@2b54082)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.5.0.470 (remotes/origin/d16-5@681de3fd6)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.5.49 (0904f41)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 10.2.0.100 (d16-5/988c811)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: c0c5c78
Java.Interop: xamarin/java.interop/d16-5@fc18c54
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@46204c4
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-5@9f4ed4b

Xamarin.iOS and Xamarin.Mac SDK 13.16.0.11 (aa73e41)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Log File

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions