Skip to content

PTChannelManagerDelegate segfaults when constructed #16792

@trampster

Description

@trampster

Steps to Reproduce

  1. Inherit from PTChannelManagerDelegate
   public class MyChannelManagerDelegate : PTChannelManagerDelegate
   {
      public override void DidActivateAudioSession(PTChannelManager channelManager, AVAudioSession audioSession)
      {
      }

      public override void DidBeginTransmitting(PTChannelManager channelManager, NSUuid channelUuid, PTChannelTransmitRequestSource source)
      {
      }

      public override void DidDeactivateAudioSession(PTChannelManager channelManager, AVAudioSession audioSession)
      {
      }

      public override void DidEndTransmitting(PTChannelManager channelManager, NSUuid channelUuid, PTChannelTransmitRequestSource source)
      {
      }

      public override void DidJoinChannel(PTChannelManager channelManager, NSUuid channelUuid, PTChannelJoinReason reason)
      {
      }

      public override void DidLeaveChannel(PTChannelManager channelManager, NSUuid channelUuid, PTChannelLeaveReason reason)
      {
      }

      public override PTPushResult IncomingPushResult(PTChannelManager channelManager, NSUuid channelUuid, NSDictionary<NSString, NSObject> pushPayload)
      {
         return PTPushResult.LeaveChannelPushResult;
      }

      public override void ReceivedEphemeralPushToken(PTChannelManager channelManager, NSData pushToken)
      {
      }
   }
  1. Try to construct your type
    var myChannelManagerDelegate = new MyChannelManagerDelegate();
  1. segfault occurs

Expected Behavior

Can construct a type which inherits from PTChannelManagerDelegate without a segfault

Actual Behavior

Segfault occurs when constructing type which inherits from PTChannelManagerDelegate.

=================================================================
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:
=================================================================
0x10b80ab30 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : mono_dump_native_crash_info
0x10b800c7c - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : mono_handle_native_crash
0x10b80efa8 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : mono_sigsegv_signal_handler_debug
0x207891a90 - /usr/lib/system/libsystem_platform.dylib : <redacted>
0x108a4d244 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : wrapper_managed_to_native_ObjCRuntime_Messaging_IntPtr_objc_msgSendSuper_intptr_intptr
0x107915970 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : PushToTalk_PTChannelManagerDelegate__ctor
0x105503614 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : Pttox_Forms_iOS_Services_PTChannelService__ctor_Pttox_Core_Services_IPttClient_Pttox_Core_Services_IConfigProvider_Pttox_Core_Services_Provisioning_IProvisioningService_Pttox_Forms_iOS_Services_ApnsTokenPublisher
0x1054f8860 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : Pttox_Forms_iOS_Services_PttoxIosModule_CreatePTChannelService_Pttox_Core_Services_IPttClient_Pttox_Core_Services_IConfigProvider_Pttox_Core_Services_Provisioning_IProvisioningService_Pttox_Forms_iOS_Services_ApnsTokenPublisher
0x1054f0f08 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : Pttox_Forms_iOS_Services_PttoxIosContainer_global__StrongInject_IContainer_Pttox_Forms_iOS_Services_PTChannelService_Resolve
0x10967c988 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : StrongInject_ContainerExtensions_Resolve_T_REF_StrongInject_IContainer_1_T_REF
0x1054a8984 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : Pttox_Forms_iOS_Services_AppDelegate_FinishedLaunching_UIKit_UIApplication_Foundation_NSDictionary
0x105e58480 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr
0x10b8123f0 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : mono_jit_runtime_invoke
0x10b8ccbbc - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : mono_runtime_invoke_checked
0x10b8d03fc - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : mono_runtime_invoke
0x1053dbe7c - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : _ZL31native_to_managed_trampoline_18P11objc_objectP13objc_selectorPP11_MonoMethodS0_S0_j
0x1053dc654 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : -[AppDelegate application:didFinishLaunchingWithOptions:]
0x1bd4e4f40 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd4e4664 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd4e3640 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd4e328c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd228d64 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UIScenePerformActionsWithLifecycleActionMask
0x1bd56ac3c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd41b888 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd41b6b0 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd41b260 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd41b12c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bdaf95a0 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bdb9196c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion
0x1bd2c72d8 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd739048 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd399bec - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd399a5c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd398fb0 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd398d3c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1d0971d48 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
0x1d09b1104 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
0x1d0975ae4 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
0x1d09b0d3c - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
0x1c2481fdc - /usr/lib/system/libdispatch.dylib : <redacted>
0x1c2485a5c - /usr/lib/system/libdispatch.dylib : <redacted>
0x1d097ff2c - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
0x1d097fac8 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
0x1d09822a8 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
0x1bb0d222c - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
0x1bb0de614 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
0x1bb06251c - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
0x1bb077eb8 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
0x1bb07d1e4 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : CFRunLoopRunSpecific
0x1f3e9d368 - /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices : GSEventRunModal
0x1bd52cd88 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x1bd52c9ec - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : UIApplicationMain
0x10b999fa0 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : xamarin_UIApplicationMain
0x108a42970 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : wrapper_managed_to_native_UIKit_UIApplication_xamarin_UIApplicationMain_int_string___intptr_intptr_intptr_
0x1082cb074 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr
0x1082cb170 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : UIKit_UIApplication_Main_string___string_string
0x1054a2040 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : Pttox_Forms_iOS_Application_Main_string__
0x105e58480 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr
0x10b8123f0 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : mono_jit_runtime_invoke
0x10b8ccbbc - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : mono_runtime_invoke_checked
0x10b8d2ec4 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : mono_runtime_exec_main_checked
0x10b7f0758 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : mono_jit_exec
0x10b9d8ae8 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : xamarin_main
0x1054a1c78 - /private/var/containers/Bundle/Application/B2105AB1-A64C-4F5B-B943-A36234825913/Pttox.Forms.iOS.app/Pttox.Forms.iOS : main
0x1d93a1948 - /usr/lib/dyld : <redacted>

=================================================================
Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x1b43bdeb8):0x1b43bdea8  30 02 40 f9 71 b5 f6 f2 30 1a c1 da ef 03 10 aa  0.@.q...0.......
0x1b43bdeb8  0b 0a 40 f9 eb 02 00 37 6a bd 40 92 2c 1c 41 ca  ..@....7j.@.,.A.
0x1b43bdec8  8c c1 4b 8a 4d 11 0c 8b b1 25 ff a8 3f 01 01 eb  ..K.M....%..?...
0x1b43bded8  81 00 00 54 4a 01 01 ca 4a 01 10 ca 2a 0e 1f d7  ...TJ...J...*...

=================================================================
Managed Stacktrace:
=================================================================
 at <unknown> <0xffffffff>
 at ObjCRuntime.Messaging:IntPtr_objc_msgSendSuper <0x00007>
 at PushToTalk.PTChannelManagerDelegate:.ctor <0x0008f>
 at Pttox.Forms.iOS.Services.PTChannelService:.ctor <0x00073>
 at Pttox.Forms.iOS.Services.PttoxIosModule:CreatePTChannelService <0x000bf>
 at Pttox.Forms.iOS.Services.PttoxIosContainer:global::StrongInject.IContainer<Pttox.Forms.iOS.Services.PTChannelService>.Resolve <0x002a7>
 at StrongInject.ContainerExtensions:Resolve <0x00087>
 at Pttox.Forms.iOS.Services.AppDelegate:FinishedLaunching <0x003b3>
 at System.Object:runtime_invoke_dynamic <0x0010f>
 at <unknown> <0xffffffff>
 at UIKit.UIApplication:xamarin_UIApplicationMain <0x00007>
 at UIKit.UIApplication:UIApplicationMain <0x00033>
 at UIKit.UIApplication:Main <0x0005f>
 at Pttox.Forms.iOS.Application:Main <0x0007f>
 at System.Object:runtime_invoke_dynamic <0x0010f>
=================================================================

Environment

Version information
Visual Studio Professional 2022 for Mac
Version 17.4 (build 2406)
Installation UUID: f5a42f2e-00e9-4432-b1c9-ece20cec717c

Runtime
.NET 6.0.9 (64-bit)
Architecture: X64

Roslyn (Language Service)
6.4.0-3.22461.4+8ab250290a4010c11a21521f78dbc87dbb7aac81

NuGet
Version: 6.3.1.1

.NET SDK (x64)
SDK: /usr/local/share/dotnet/sdk/7.0.100/Sdks
SDK Versions:
	7.0.100
	7.0.403
	6.0.402
	6.0.300
	6.0.101
	4.1.425
	3.1.424
	3.1.419
	3.1.411
	3.1.407
	3.1.404
	3.1.403
	3.1.402
	3.1.401
	3.1.302
	3.1.301
	3.1.300
	3.0.103
MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET Runtime (x64)
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	8.0.0
	6.0.11
	6.0.10
	6.0.5
	6.0.1
	6.0.17
	5.0.8
	5.0.4
	5.0.1
	5.0.0
	3.1.31
	3.1.30
	3.1.25
	3.1.17
	3.1.13
	3.1.10
	3.1.9
	3.1.8
	3.1.7
	3.1.6
	3.1.5
	3.1.4
	3.0.3
	2.1.23
	2.1.22
	2.1.21
	2.1.20
	2.1.19
	2.1.18

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

Updater
Version: 11

Apple Developer Tools
Xcode 14.1 (21534.1)
Build 14B47b

Xamarin.Mac
Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

Xamarin.iOS
Version: 16.0.0.72 (Visual Studio Professional)
Hash: 6756a1146
Branch: release/6.0.4xx-xcode14
Build date: 2022-09-21 08:51:06-0400

Xamarin Designer
Version: 17.4.0.136
Hash: d49c9ff6d3
Branch: remotes/origin/d17-4
Build date: 2022-11-02 23:42:23 UTC

Xamarin.Android
Version: 13.1.0.1 (Visual Studio Professional)
Commit: xamarin-android/d17-4/13ba222
Android SDK: /Users/unifydev/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		12.0 (API level 31)
		11.0 (API level 30)
		10.0 (API level 29)
		9.0  (API level 28)
		13.0 (API level 33)

SDK Command-line Tools Version: 7.0
SDK Platform Tools Version: 33.0.2
SDK Build Tools Version: 33.0.0

Build Information: 
Mono: a96bde9
Java.Interop: xamarin/java.interop/d17-4@fcc33ce2
SQLite: xamarin/sqlite/3.39.3@23e1ae7
Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a

Microsoft Build of OpenJDK
Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
11.0.12
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Eclipse Temurin JDK
Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
1.8.0.302
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 17.4.0.54
Hash: 6eabb9e
Branch: remotes/origin/d17-4
Build date: 2022-11-02 23:42:28 UTC

Android Device Manager
Version: 0.0.0.1206
Hash: 886af39
Branch: 886af39
Build date: 2022-11-02 23:42:28 UTC

Build Information
Release ID: 1704002406
Git revision: dfb45c1152306f0d5f77334f9d026b0aadb7ec90
Build date: 2022-11-02 23:40:15+00
Build branch: release-17.4
Build lane: release-17.4

Operating System
Mac OS X 12.6.1
Darwin 21.6.0 Darwin Kernel Version 21.6.0
    Thu Sep 29 20:12:57 PDT 2022
    root:xnu-8020.240.7~1/RELEASE_X86_64 x86_64

Build Logs

I tried to follow the instructions to upload the binlog file but it doesn't work with error
"We don't support that file type.....

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIf 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