Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

[Bug] Xamarin.MacOS DeviceDisplay.MainDisplayInfo crashed

Open tekmun opened this issue 4 years ago • 6 comments

Description

DeviceDisplay.MainDisplayInfo on Xamarin.MacOS crashed the app.

Steps to Reproduce

  1. Create a simple app and call this function DeviceDisplay.MainDisplayInfo.Rotation, DeviceDisplay.MainDisplayInfo.Height or DeviceDisplay.MainDisplayInfo.Width

Expected Behavior

DeviceDisplay.MainDisplayInfo returns the width, height or rotation of the device.

Actual Behavior

DeviceDisplay.MainDisplayInfo crashed the app.

Basic Information

  • Version with issue:
  • Last known good version:
  • IDE:
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • UWP:
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

Reproduction Link

tekmun avatar Feb 08 '21 01:02 tekmun

Also having this issue on Xamarin.Mac... Seems to be when it gets the refresh rate.

at <0xffffffff> at CoreVideo.CVDisplayLink:CVDisplayLinkGetNominalOutputVideoRefreshPeriod <0x000b2> at CoreVideo.CVDisplayLink:get_NominalOutputVideoRefreshPeriod <0x0004a> at Xamarin.Essentials.CVDisplayLinkInterop:GetRefreshRate <0x000f2> at Xamarin.Essentials.DeviceDisplay:GetMainDisplayInf

External Debugger Dump:

================================================================= o <0x000f2> at Xamarin.Essentials.DeviceDisplay:get_MainDisplayInfo <0x00042> at FulgazCore.Renderers.CoreAngledButtonRenderer:Render <0x0017a> at FulgazForms.FormsRendererShellSoftwareView:OnPaintSurface <0x0023b> at SkiaSharp.Views.Forms.SKCanvasView:SkiaSharp.Views.Forms.ISKCanvasViewController.OnPaintSurface <0x00042> at SkiaSharp.Views.Forms.SKCanvasViewRendererBase`2:OnPaintSurface <0x000e9> at SkiaSharp.Views.Mac.SKCanvasView:OnPaintSurface <0x00059> at SkiaSharp.Views.Mac.SKCanvasView:DrawRect <0x0036d> at <Module>:runtime_invoke_void__this___CGRect <0x000fd>

theescapers avatar Mar 05 '21 05:03 theescapers

What version of macOS are you running on?

jamesmontemagno avatar Apr 13 '21 22:04 jamesmontemagno

The latest MacOS version BigSur. This happens in Ad-Hoc and AppStore build. Debug build is working well.

tekmun avatar Apr 18 '21 02:04 tekmun

Hmmm perhaps the linker is doing some stuff....

Can you link skip Xamarin.Essentials and try that.

jamesmontemagno avatar Apr 21 '21 23:04 jamesmontemagno

Started to see the same or a very similar issue.

System.EntryPointNotFoundException
CVDisplayLinkCreateWithCGDisplay assembly:<unknown assembly> type:<unknown type> member:(null)
double CVDisplayLinkInterop.GetRefreshRate(uint display)

Would appreciate a fix or fallback handling for the refresh rate. Crashed on a "MacBookAir8,1 "running macOS Monterey

tipa avatar Nov 08 '21 08:11 tipa

i get the same

=================================================================
	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:
=================================================================
	0x1009fe846 - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : mono_dump_native_crash_info
	0x1009f23be - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : mono_handle_native_crash
	0x100cb86e7 - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : altstack_handle_and_restore.cold.1
	0x10096e48e - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : altstack_handle_and_restore
	0x7fff6b201e69 - /usr/lib/libobjc.A.dylib : objc_msgSend
	0x7fff341f78cd - /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo : CVDisplayLinkGetNominalOutputVideoRefreshPeriod
	0x10b339e3d - Unknown
	0x10b339bab - Unknown
	0x10b3389e3 - Unknown
	0x10b337ac3 - Unknown
	0x10b337533 - Unknown
	0x10a54d683 - Unknown
	0x10a54db04 - Unknown
	0x100a09193 - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : mono_jit_runtime_invoke
	0x100b3d7b8 - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : mono_runtime_invoke_checked
	0x100b4209e - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : mono_runtime_invoke
	0x10091926c - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : xamarin_invoke_trampoline
	0x10091b009 - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : xamarin_arch_trampoline
	0x10091c1e6 - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : xamarin_x86_64_common_trampoline
	0x7fff32239259 - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
	0x7fff322391ed - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : ___CFXRegistrationPost1_block_invoke
	0x7fff32239162 - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : _CFXRegistrationPost1
	0x7fff32238dce - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : ___CFXNotificationPost_block_invoke
	0x7fff32208fbc - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : -[_CFXNotificationRegistrar find:object:observer:enumerator:]
	0x7fff32208385 - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : _CFXNotificationPost
	0x7fff348a8786 - /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation : -[NSNotificationCenter postNotificationName:object:userInfo:]
	0x7fff2f4ab4f3 - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : -[NSApplication _postDidFinishNotification]
	0x7fff2f4ab232 - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : -[NSApplication _sendFinishLaunchingNotification]
	0x7fff2f4a82f3 - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:]
	0x7fff2f4a7f38 - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:]
	0x7fff348d3a26 - /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation : -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:]
	0x7fff348d3890 - /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation : _NSAppleEventManagerGenericHandler
	0x7fff335d8203 - /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE : _AppleEventsCheckInAppWithBlock
	0x7fff335d7929 - /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE : _AppleEventsCheckInAppWithBlock
	0x7fff335cfbd7 - /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE : aeProcessAppleEvent
	0x7fff30e6e7fa - /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox : AEProcessAppleEvent
	0x7fff2f4a22d1 - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : _DPSNextEvent
	0x7fff2f4a0880 - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
	0x7fff2f49258e - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : -[NSApplication run]
	0x7fff2f464396 - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : NSApplicationMain
	0x10a3e2db7 - Unknown
	0x10a3b4ec3 - Unknown
	0x1037d58fb - Unknown
	0x1037d5a91 - Unknown
	0x100a09193 - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : mono_jit_runtime_invoke
	0x100b3d7b8 - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : mono_runtime_invoke_checked
	0x100b44b85 - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : mono_runtime_exec_main_checked
	0x1009642bc - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : mono_jit_exec
	0x100967358 - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : mono_main
	0x10091cb99 - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : xamarin_main
	0x10091d9a4 - /Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MacOS/Xamarin DAW : main
	0x7fff6c3aecc9 - /usr/lib/system/libdyld.dylib : start

=================================================================
	Telemetry Dumper:
=================================================================
Pkilling 0x123145351286784x from 0x4491218368x
Pkilling 0x123145349177344x from 0x4491218368x
Entering thread summarizer pause from 0x4491218368x
Could not exec mono-hang-watchdog, expected on path '/Users/smallville7123/Projects/Xamarin_DAW/Xamarin_DAW.MacOS/bin/Debug/Xamarin DAW.app/Contents/MonoBundle/../bin/mono-hang-watchdog' (errno 2)
Finished thread summarizer pause from 0x4491218368x.
Failed to create breadcrumb file (null)/crash_hash_0xb2ca947bd

Waiting for dumping threads to resume

=================================================================
	External Debugger Dump:
=================================================================

=================================================================
	Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x7fff6b201e69):0x7fff6b201e59  17 49 89 f3 45 23 5a 18 49 c1 e3 04 4d 03 5a 10  .I..E#Z.I...M.Z.
0x7fff6b201e69  49 3b 33 75 0a 4d 8b 5b 08 4d 31 d3 41 ff e3 49  I;3u.M.[.M1.A..I
0x7fff6b201e79  83 3b 01 76 13 49 83 c3 10 49 3b 33 75 f1 4d 8b  .;.v.I...I;3u.M.
0x7fff6b201e89  5b 08 4d 31 d3 41 ff e3 72 70 4d 8b 5b 08 eb 0a  [.M1.A..rpM.[...

=================================================================
	Managed Stacktrace:
=================================================================
	  at <unknown> <0xffffffff>
	  at CoreVideo.CVDisplayLink:CVDisplayLinkGetNominalOutputVideoRefreshPeriod <0x0013c>
	  at CoreVideo.CVDisplayLink:get_NominalOutputVideoRefreshPeriod <0x000ea>
	  at Xamarin.Essentials.CVDisplayLinkInterop:GetRefreshRate <0x00232>
	  at Xamarin.Essentials.DeviceDisplay:GetMainDisplayInfo <0x002d2>
	  at Xamarin.Essentials.DeviceDisplay:add_MainDisplayInfoChanged <0x00122>
	  at Xamarin_DAW.MacOS.AppDelegate:DidFinishLaunching <0x001b2>
	  at <Module>:runtime_invoke_void__this___object <0x00113>
	  at <unknown> <0xffffffff>
	  at AppKit.NSApplication:NSApplicationMain <0x00276>
	  at AppKit.NSApplication:Main <0x00292>
	  at Xamarin_DAW.MacOS.MainClass:Main <0x0018a>
	  at <Module>:runtime_invoke_void_object <0x00110>
=================================================================
=== Visual Studio Community 2019 for Mac ===

Version 8.10.19 (build 2)
Installation UUID: 1f3e0cd0-4418-410b-9194-de968f0767e2
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

	Package version: 612000162

=== Mono Framework MDK ===

Runtime:
	Mono 6.12.0.162 (2020-02/2ca650f1f62) (64-bit)
	Package version: 612000162

=== Roslyn (Language Service) ===

3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb

=== NuGet ===

Version: 5.9.0.7134

=== .NET SDK (x64) ===

SDK: /usr/local/share/dotnet/sdk/6.0.200/Sdks
SDK Versions:
	6.0.200
	6.0.102
	5.0.405
	3.1.416
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	6.0.2
	5.0.14
	3.1.22

=== .NET Core 3.1 SDK ===

SDK: 3.1.416

=== .NET 5.0 SDK ===

SDK: 5.0.405

=== Xamarin Designer ===

Version: 16.11.0.60
Hash: 56f9b80b0
Branch: remotes/origin/d16-11
Build date: 2021-12-15 02:44:16 UTC

=== Xamarin.Profiler ===

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

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.4 (17801)
Build 12D4e

=== Xamarin.Mac ===

Version: 8.6.0.3 (Visual Studio Community)
Hash: caa899d24
Branch: d17-1
Build date: 2022-01-16 21:16:56-0500

=== Xamarin.iOS ===

Xamarin.iOS not installed.
Can't find mtouch or the Version file at /Library/Frameworks/Xamarin.iOS.framework/Versions/Current.

=== Xamarin.Android ===

Version: 12.0.0.3 (Visual Studio Community)
Commit: xamarin-android/d16-11/f0e3c2d
Android SDK: /Users/smallville7123/Library/Android/sdk
	Supported Android versions:
		None installed

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 31.0.3
SDK Build Tools Version: 31.0.0

Build Information: 
Mono: c633fe9
Java.Interop: xamarin/java.interop/d16-11@476bb5b
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.35.4@85460d3
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-11@87af37b

=== Eclipse Temurin JDK ===

Java SDK: Not Found

=== Android SDK Manager ===

Version: 16.10.0.13
Hash: 1b81df5
Branch: remotes/origin/d16-10
Build date: 2021-11-12 01:17:32 UTC

=== Android Device Manager ===

Version: 16.10.0.15
Hash: 89dcc0b
Branch: remotes/origin/d16-10
Build date: 2021-11-12 01:17:52 UTC

=== Build Information ===

Release ID: 810190002
Git revision: 632b6ca654e2733a685bfc9c6a0686e0a317092b
Build date: 2022-02-09 13:38:14-05
Build branch: release-8.10

=== Operating System ===

Mac OS X 10.15.7
Darwin 19.6.0 Darwin Kernel Version 19.6.0
    Thu Oct 29 22:56:45 PDT 2020
    root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64

=== Enabled user installed extensions ===

Xamarin.Forms HotReload extension 1.4.0
Xamarin.AndroidStudio 0.7.0

mgood7123 avatar Feb 28 '22 16:02 mgood7123