Bug 34519 - [__NSMallocBlock__ xamarinSetGCHandle:] unrecognized selector in El Capitán
Summary: [__NSMallocBlock__ xamarinSetGCHandle:] unrecognized selector in El Capitán
Status: VERIFIED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: 2.4.0 (C6)
Hardware: PC Mac OS
: --- normal
Target Milestone: 2.4.0 (C6)
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
: 33899 ()
Depends on:
Blocks:
 
Reported: 2015-10-02 08:38 UTC by Rodrigo Moya
Modified: 2015-10-21 13:00 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Rodrigo Moya 2015-10-02 08:38:28 UTC
After upgrading to El Capitán, I've started getting this error:

[__NSMallocBlock__ xamarinSetGCHandle:]: unrecognized selector sent to instance 0x11082f7a0

And get some different stack traces:

2015-10-02 14:30:47.754 Xamarin Profiler[1953:617040] -[__NSMallocBlock__ xamarinSetGCHandle:]: unrecognized selector sent to instance 0x10f3fa620
2015-10-02 14:30:47.754 Xamarin Profiler[1953:617040] -[__NSMallocBlock__ xamarinSetGCHandle:]: unrecognized selector sent to instance 0x10f3fa620
2015-10-02 14:30:47.762 Xamarin Profiler[1953:617040] (
	0   CoreFoundation                      0x00007fff8cec8bd2 __exceptionPreprocess + 178
	1   libobjc.A.dylib                     0x00007fff9a81a4fa objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff8cf320ed -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
	3   CoreFoundation                      0x00007fff8ce393d1 ___forwarding___ + 1009
	4   CoreFoundation                      0x00007fff8ce38f58 _CF_forwarding_prep_0 + 120
	5   Xamarin Profiler                    0x00000001000120da _ZL16set_raw_gchandleP11objc_objecti + 42
	6   Xamarin Profiler                    0x000000010001223f xamarin_free_gchandle + 47
	7   Xamarin Profiler                    0x0000000100013565 xamarin_notify_dealloc + 69
	8   Xamarin Profiler                    0x000000010001285a -[XamarinAssociatedObject dealloc] + 58
	9   libobjc.A.dylib                     0x00007fff9a80f35e _object_remove_assocations + 347
	10  libobjc.A.dylib                     0x00007fff9a80f1d3 objc_destructInstance + 109
	11  libsystem_blocks.dylib              0x00007fff9b33e6ba _Block_release + 137
	12  CoreFoundation                      0x00007fff8ce54d4c -[_CFXNotificationTokenRegistration removeFromParent] + 44
	13  CoreFoundation                      0x00007fff8ce41042 -[_CFXNotificationRegistrar match:object:observer:enumerator:] + 2786
	14  CoreFoundation                      0x00007fff8ce4052c _CFXNotificationRemoveObservers + 220
	15  Foundation                          0x00007fff8fe2fd5c -[NSNotificationCenter removeObserver:name:object:] + 227
	16  AppKit                              0x00007fff964e25a5 -[NSWindow _discardCursorRectsForView:] + 323
	17  AppKit                              0x00007fff965d2dd0 -[NSView(NSInternal) _updateTrackingAreas] + 340
	18  AppKit                              0x00007fff965d33c2 -[NSView(NSInternal) _updateTrackingAreas] + 1862
	19  AppKit                              0x00007fff965d33c2 -[NSView(NSInternal) _updateTrackingAreas] + 1862
	20  AppKit                              0x00007fff96c797cc ___NSWindowGetDisplayCycleObserver_block_invoke6334 + 1265
	21  AppKit                              0x00007fff96628e66 __37+[NSDisplayCycle currentDisplayCycle]_block_invoke19 + 292
	22  QuartzCore                          0x00007fff9260091d _ZN2CA11Transaction19run_commit_handlersE18CATransactionPhase + 85
	23  QuartzCore                          0x00007fff925fff3b _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 515
	24  QuartzCore                          0x00007fff925ffa98 _ZN2CA11Transaction6commitEv + 508
	25  QuartzCore                          0x00007fff9260b28f _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 71
	26  CoreFoundation                      0x00007fff8ce5de07 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
	27  CoreFoundation                      0x00007fff8ce5dd77 __CFRunLoopDoObservers + 391
	28  CoreFoundation                      0x00007fff8ce3cd58 CFRunLoopRunSpecific + 328
	29  HIToolbox                           0x00007fff8d3d6d55 RunCurrentEventLoopInMode + 235
	30  HIToolbox                           0x00007fff8d3d6b8f ReceiveNextEventCommon + 432
	31  HIToolbox                           0x00007fff8d3d69cf _BlockUntilNextEventMatchingListInModeWithFilter + 71
	32  AppKit                              0x00007fff964a2f3a _DPSNextEvent + 1067
	33  AppKit                              0x00007fff964a2369 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
	34  AppKit                              0x00007fff96496ecc -[NSApplication run] + 682
	35  AppKit                              0x00007fff96460162 NSApplicationMain + 1176
	36  ???                                 0x00000001099cc22e 0x0 + 4456235566
	37  ???                                 0x00000001099cc0a4 0x0 + 4456235172
	38  Xamarin Profiler                    0x0000000100104485 mono_jit_runtime_invoke + 1765
	39  Xamarin Profiler                    0x00000001001ab5de mono_runtime_invoke + 110
	40  Xamarin Profiler                    0x00000001001b0d2b mono_runtime_exec_main + 379
	41  Xamarin Profiler                    0x00000001000686c3 mono_main + 8003
	42  Xamarin Profiler                    0x0000000100016b05 main + 789
	43  Xamarin Profiler                    0x00000001000017f4 start + 52

And:

2015-10-02 14:30:50.165 Xamarin Profiler[1953:617040] -[__NSMallocBlock__ xamarinSetGCHandle:]: unrecognized selector sent to instance 0x1112ca040
2015-10-02 14:30:50.165 Xamarin Profiler[1953:617040] -[__NSMallocBlock__ xamarinSetGCHandle:]: unrecognized selector sent to instance 0x1112ca040
2015-10-02 14:30:50.166 Xamarin Profiler[1953:617040] (
	0   CoreFoundation                      0x00007fff8cec8bd2 __exceptionPreprocess + 178
	1   libobjc.A.dylib                     0x00007fff9a81a4fa objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff8cf320ed -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
	3   CoreFoundation                      0x00007fff8ce393d1 ___forwarding___ + 1009
	4   CoreFoundation                      0x00007fff8ce38f58 _CF_forwarding_prep_0 + 120
	5   Xamarin Profiler                    0x00000001000120da _ZL16set_raw_gchandleP11objc_objecti + 42
	6   Xamarin Profiler                    0x000000010001223f xamarin_free_gchandle + 47
	7   Xamarin Profiler                    0x0000000100013565 xamarin_notify_dealloc + 69
	8   Xamarin Profiler                    0x000000010001285a -[XamarinAssociatedObject dealloc] + 58
	9   libobjc.A.dylib                     0x00007fff9a80f35e _object_remove_assocations + 347
	10  libobjc.A.dylib                     0x00007fff9a80f1d3 objc_destructInstance + 109
	11  libsystem_blocks.dylib              0x00007fff9b33e6ba _Block_release + 137
	12  CoreFoundation                      0x00007fff8ce5e1f7 CFRunLoopObserverInvalidate + 295
	13  CoreFoundation                      0x00007fff8ce5dd85 __CFRunLoopDoObservers + 405
	14  CoreFoundation                      0x00007fff8ce3d308 __CFRunLoopRun + 872
	15  CoreFoundation                      0x00007fff8ce3cd38 CFRunLoopRunSpecific + 296
	16  HIToolbox                           0x00007fff8d3d6d55 RunCurrentEventLoopInMode + 235
	17  HIToolbox                           0x00007fff8d3d6a97 ReceiveNextEventCommon + 184
	18  HIToolbox                           0x00007fff8d3d69cf _BlockUntilNextEventMatchingListInModeWithFilter + 71
	19  AppKit                              0x00007fff964a2f3a _DPSNextEvent + 1067
	20  AppKit                              0x00007fff964a2369 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
	21  AppKit                              0x00007fff96496ecc -[NSApplication run] + 682
	22  AppKit                              0x00007fff96460162 NSApplicationMain + 1176
	23  ???                                 0x00000001099cc22e 0x0 + 4456235566
	24  ???                                 0x00000001099cc0a4 0x0 + 4456235172
	25  Xamarin Profiler                    0x0000000100104485 mono_jit_runtime_invoke + 1765
	26  Xamarin Profiler                    0x00000001001ab5de mono_runtime_invoke + 110
	27  Xamarin Profiler                    0x00000001001b0d2b mono_runtime_exec_main + 379
	28  Xamarin Profiler                    0x00000001000686c3 mono_main + 8003
	29  Xamarin Profiler                    0x0000000100016b05 main + 789
	30  Xamarin Profiler                    0x00000001000017f4 start + 52
Comment 1 Kevin Mullins 2015-10-02 08:44:48 UTC
I too am experiencing the same issue when run an app compiled and run on El Capitan. A few moments after the app enters the background, I fail with the same messages as above.

Here is a sample app that is showing this issue: 
https://github.com/xamarin/private-samples/tree/master/edu/OnCard

Run the app in debug mode, drop it's window behind all other windows and leave it there for a minute. The crash will happen.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2015-10-05 09:19:52 UTC
Which version of Xamarin.Mac are you guys using? Can you paste the complete version information from Xamarin Studio's About Box?
Comment 3 Kevin Mullins 2015-10-05 09:21:34 UTC
Here you go:

Xamarin Studio
Version 5.10 (build 800)
Installation UUID: 0e99c8fb-a1c1-404a-b951-c622bb99389f
Runtime:
	Mono 4.2.1 (explicit/4a18c57)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010056

Xamarin.Profiler
Not Installed

Apple Developer Tools
Xcode 7.0.1 (8228)
Build 7A1001

Xamarin.iOS
Version: 9.2.0.67 (Business Edition)
Hash: f85a845
Branch: master
Build date: 2015-09-23 10:34:01-0400

Xamarin.Android
Version: 6.0.0.2 (Business Edition)
Android SDK: /Users/kmullins/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)

SDK Tools Version: 24.3.3
SDK Platform Tools Version: 22
SDK Build Tools Version: 23.0.0

Java SDK: /usr
java version "1.8.0_20-ea"
Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b23)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b22, mixed mode)

Xamarin Android Player
Version: 0.2.5
Location: /Applications/Xamarin Android Player.app

Xamarin.Mac
Version: 2.4.0.62 (Business Edition)

Build Information
Release ID: 510000800
Git revision: 92083188182e8c4588153e0d63e99c1a7037e4b6
Build date: 2015-09-18 15:03:06-04
Xamarin addins: 97a862a9dcaa31e9044c8613ef42e0a588c8d012
Build lane: monodevelop-lion-cycle6

Operating System
Mac OS X 10.11.0
Darwin Europa-7.local 15.0.0 Darwin Kernel Version 15.0.0
    Wed Aug 26 16:57:32 PDT 2015
    root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64
Comment 4 Rodrigo Moya 2015-10-05 10:02:28 UTC
Mine:

=== Xamarin Studio ===

Version 5.10 (build 800)
Installation UUID: 0a9ae72a-48a9-4853-ab6a-fe231f5fca0b
Runtime:
	Mono 4.2.1 (explicit/4a18c57)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010056

=== Xamarin.Profiler ===

Version: 0.20.0.0
Location: /Users/rodrigo/Projects/xamarin/profiler/bin/Debug/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 7.0.1 (8228)
Build 7A1001

=== Xamarin.Android ===

Version: 6.0.0.2 (Business Edition)
Android SDK: /Users/rodrigo/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)

SDK Tools Version: 24.3.4
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 20

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Not Installed

=== Xamarin.iOS ===

Version: 9.2.0.67 (Business Edition)
Hash: f85a845
Branch: master
Build date: 2015-09-23 10:34:01-0400

=== Xamarin.Mac ===

Version: 2.4.0.62 (Business Edition)

=== Build Information ===

Release ID: 510000800
Git revision: 92083188182e8c4588153e0d63e99c1a7037e4b6
Build date: 2015-09-18 15:03:06-04
Xamarin addins: 97a862a9dcaa31e9044c8613ef42e0a588c8d012
Build lane: monodevelop-lion-cycle6

=== Operating System ===

Mac OS X 10.11.0
Darwin cogulla.local 15.0.0 Darwin Kernel Version 15.0.0
    Wed Aug 26 16:57:32 PDT 2015
    root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64
Comment 5 Rolf Bjarne Kvinge [MSFT] 2015-10-06 06:59:45 UTC
Fixed.

maccore/master: 1c83f586651346a024db1ab8fda747b5a87fdd2e
Comment 7 Jatin 2015-10-09 10:50:04 UTC
I am able to reproduce this issue with C6 xamarin.mac-2.4.0.80_7bcf0dacf2f066d7c433e5cebdbcfb1ca9cd1e12 and observed that this issue does not exist with master xamarin.mac-2.5.0.137_2fb8866b34ee507c5457bb77af32dedb01d20796.

Hence closing this issue by marking it as Verified.

thanks
Comment 8 Rolf Bjarne Kvinge [MSFT] 2015-10-21 13:00:52 UTC
*** Bug 33899 has been marked as a duplicate of this bug. ***