Skip to content

App crash when using IUIPopoverPresentationControllerDelegate WillRepositionPopover #22837

Closed
@KolbyRKunz

Description

@KolbyRKunz

Apple platform

iOS

Framework version

net9.0-*

Affected platform version

.Net 9.102

Description

If you use the binding for WillRepositionPopover at all it will cause a crash on simulators (iPhone and iPad). I have attempted to simply call base in the method and that will cause the crash as well. Physical devices seem to be unaffected by this issue.

Steps to Reproduce

  1. Create a tableview that presents a popover view when cells are tapped.
  2. Have the view implement IUIPopoverPresentationControllerDelegate
  3. Override the WillRepositionPopover function
  4. Run the app and attempt to present the popover

Did you find any workaround?

Run on a physical device to avoid crashing.

Relevant log output

Unhandled Exception:
ObjCRuntime.RuntimeException: Invalid type encoding for parameter
at ObjCRuntime.Runtime.ThrowException(IntPtr gchandle) in /Users/builder/azdo/_work/9/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:line 2742
at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/9/s/xamarin-macios/src/UIKit/UIApplication.cs:line 64
at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/9/s/xamarin-macios/src/UIKit/UIApplication.cs:line 96
at Program.

$(String[] args) in /Users/user/RiderProjects/ExampleApp/ExampleApp/Main.cs:line 6
2025-05-19 13:12:00.510539-0600 ExampleApp[55839:10861933] Unhandled managed exception: Invalid type encoding for parameter (ObjCRuntime.RuntimeException)
at ObjCRuntime.Runtime.ThrowException(IntPtr gchandle) in /Users/builder/azdo/_work/9/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:line 2742
at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/9/s/xamarin-macios/src/UIKit/UIApplication.cs:line 64
at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/9/s/xamarin-macios/src/UIKit/UIApplication.cs:line 96
at Program.$(String[] args) in /Users/user/RiderProjects/ExampleApp/ExampleApp/Main.cs:line 6

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

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

0x11533386c - /Users/user/Library/Developer/CoreSimulator/Devices/20935E50-762F-4563-A8DA-80525EBD636E/data/Containers/Bundle/Application/A60C3EBF-2629-483F-B8AF-C10FE83D19D4/ExampleApp.app/libmonosgen-2.0.dylib : mono_dump_native_crash_info
0x1152e0704 - /Users/user/Library/Developer/CoreSimulator/Devices/20935E50-762F-4563-A8DA-80525EBD636E/data/Containers/Bundle/Application/A60C3EBF-2629-483F-B8AF-C10FE83D19D4/ExampleApp.app/libmonosgen-2.0.dylib : mono_handle_native_crash
0x1154ab3f0 - /Users/user/Library/Developer/CoreSimulator/Devices/20935E50-762F-4563-A8DA-80525EBD636E/data/Containers/Bundle/Application/A60C3EBF-2629-483F-B8AF-C10FE83D19D4/ExampleApp.app/libmonosgen-2.0.dylib : sigabrt_signal_handler.cold.1
0x115333150 - /Users/user/Library/Developer/CoreSimulator/Devices/20935E50-762F-4563-A8DA-80525EBD636E/data/Containers/Bundle/Application/A60C3EBF-2629-483F-B8AF-C10FE83D19D4/ExampleApp.app/libmonosgen-2.0.dylib : mono_runtime_setup_stat_profiler
0x114c1b640 - /usr/lib/system/libsystem_platform.dylib : _sigtramp
0x114c662ec - /usr/lib/system/libsystem_pthread.dylib : pthread_kill
0x1801655c0 - /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib : abort
0x114fc8984 - /Users/user/Library/Developer/CoreSimulator/Devices/20935E50-762F-4563-A8DA-80525EBD636E/data/Containers/Bundle/Application/A60C3EBF-2629-483F-B8AF-C10FE83D19D4/ExampleApp.app/libxamarin-dotnet-debug.dylib : xamarin_find_protocol_wrapper_type
0x1153c3b40 - /Users/user/Library/Developer/CoreSimulator/Devices/20935E50-762F-4563-A8DA-80525EBD636E/data/Containers/Bundle/Application/A60C3EBF-2629-483F-B8AF-C10FE83D19D4/ExampleApp.app/libmonosgen-2.0.dylib : mono_invoke_unhandled_exception_hook
0x1152a3a94 - /Users/user/Library/Developer/CoreSimulator/Devices/20935E50-762F-4563-A8DA-80525EBD636E/data/Containers/Bundle/Application/A60C3EBF-2629-483F-B8AF-C10FE83D19D4/ExampleApp.app/libmonosgen-2.0.dylib : mono_jit_exec
0x114fddbac - /Users/user/Library/Developer/CoreSimulator/Devices/20935E50-762F-4563-A8DA-80525EBD636E/data/Containers/Bundle/Application/A60C3EBF-2629-483F-B8AF-C10FE83D19D4/ExampleApp.app/libxamarin-dotnet-debug.dylib : xamarin_main
0x10c9fb7ec - /Users/user/Library/Developer/CoreSimulator/Devices/20935E50-762F-4563-A8DA-80525EBD636E/data/Containers/Bundle/Application/A60C3EBF-2629-483F-B8AF-C10FE83D19D4/ExampleApp.app/ExampleApp : main
0x11458d544 - Unknown
0x11465eb4c - Unknown

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

Memory around native instruction pointer (0x114f08874):0x114f08864 c0 03 5f d6 c0 03 5f d6 10 29 80 d2 01 10 00 d4 .......)......
0x114f08874 e3 00 00 54 fd 7b bf a9 fd 03 00 91 16 e3 ff 97 ...T.{..........
0x114f08884 bf 03 00 91 fd 7b c1 a8 c0 03 5f d6 c0 03 5f d6 .....{........
0x114f08894 70 0a 80 d2 01 10 00 d4 e3 00 00 54 fd 7b bf a9 p..........T.{..

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

=================================================================

Metadata

Metadata

Assignees

Labels

api-bindingsbugIf an issue is a bug or a pull request a bug fix

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions