Bug 4474 - While taking a photo UIImagePicker crashed -> Selector invoked from objective-c on a managed object (0xA84E5D0) that has been GC'ed
Summary: While taking a photo UIImagePicker crashed -> Selector invoked from objective...
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-04-17 09:52 UTC by Rogier Rietdijk
Modified: 2013-12-05 18:35 UTC (History)
3 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:
RESOLVED NORESPONSE

Description Rogier Rietdijk 2012-04-17 09:52:15 UTC
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: Unhandled Exception: System.Exception: Selector invoked from objective-c on a managed object (0xA84E5D0) that has been GC'ed ---> System.MissingMethodException: No constructor found for GercoGap.GapPhotoScreen::.ctor(System.IntPtr)
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at System.Activator.CreateInstance (System.Type type, System.Object[] args, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at MonoTouch.ObjCRuntime.Runtime.ConstructNSObject (IntPtr ptr, IntPtr klass) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   --- End of inner exception stack trace ---
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at MonoTouch.ObjCRuntime.Runtime.ConstructNSObject (IntPtr ptr, IntPtr klass) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at MonoTouch.ObjCRuntime.Runtime.GetNSObject (IntPtr ptr) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at MonoTouch.ObjCRuntime.Runtime.GetNSObjectWrapped (IntPtr ptr) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at (wrapper native-to-managed) MonoTouch.ObjCRuntime.Runtime:GetNSObjectWrapped (intptr)
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at GercoGap.Application.Main (System.String[] args) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: [ERROR] FATAL UNHANDLED EXCEPTION: System.Exception: Selector invoked from objective-c on a managed object (0xA84E5D0) that has been GC'ed ---> System.MissingMethodException: No constructor found for GercoGap.GapPhotoScreen::.ctor(System.IntPtr)
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at System.Activator.CreateInstance (System.Type type, System.Object[] args, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at MonoTouch.ObjCRuntime.Runtime.ConstructNSObject (IntPtr ptr, IntPtr klass) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   --- End of inner exception stack trace ---
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at MonoTouch.ObjCRuntime.Runtime.ConstructNSObject (IntPtr ptr, IntPtr klass) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at MonoTouch.ObjCRuntime.Runtime.GetNSObject (IntPtr ptr) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at MonoTouch.ObjCRuntime.Runtime.GetNSObjectWrapped (IntPtr ptr) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at (wrapper native-to-managed) MonoTouch.ObjCRuntime.Runtime:GetNSObjectWrapped (intptr)
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>:   at GercoGap.Application.Main (System.String[] args) [0x00000] in <filename unknown>:0 
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: Terminating runtime due to unhandled exception
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: Stacktrace:
Apr 17 15:44:57 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: Native stacktrace:
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	0   GercoGap                            0x016ca8b8 mono_handle_native_sigsegv + 280
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	1   GercoGap                            0x016ecd90 sigabrt_signal_handler + 180
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	2   libsystem_c.dylib                   0x36bc27ed _sigtramp + 48
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	3   libsystem_c.dylib                   0x36bb820f pthread_kill + 54
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	4   libsystem_c.dylib                   0x36bb129f abort + 94
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	5   GercoGap                            0x017cc678 monoeg_g_logv + 152
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	6   GercoGap                            0x017cc6c4 monoeg_assertion_message + 52
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	7   GercoGap                            0x016b4290 mono_thread_abort + 148
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	8   GercoGap                            0x016ca484 mono_handle_exception_internal + 3188
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	9   GercoGap                            0x016ca688 mono_handle_exception + 24
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	10  GercoGap                            0x016eb9a4 mono_arm_throw_exception + 172
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	11  GercoGap                            0x015f0d14 throw_exception + 48
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	12  GercoGap                            0x00dc6c24 MonoTouch_ObjCRuntime_Runtime_GetNSObject_intptr + 144
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	13  GercoGap                            0x00dc6ca4 MonoTouch_ObjCRuntime_Runtime_GetNSObjectWrapped_intptr + 28
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	14  GercoGap                            0x01101470 wrapper_native_to_managed_MonoTouch_ObjCRuntime_Runtime_GetNSObjectWrapped_intptr + 64
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	15  GercoGap                            0x017d24a8 get_managed_object_for_ptr + 180
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	16  GercoGap                            0x017d5e38 monotouch_trampoline + 112
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	17  Foundation                          0x30d694ff __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_0 + 18
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	18  CoreFoundation                      0x34e94547 ___CFXNotificationPost_block_invoke_0 + 70
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	19  CoreFoundation                      0x34e20097 _CFXNotificationPost + 1406
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	20  Foundation                          0x30cdd3eb -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	21  Foundation                          0x30cdec1b -[NSNotificationCenter postNotificationName:object:] + 30
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	22  UIKit                               0x32098271 -[UIApplication _performMemoryWarning] + 80
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	23  UIKit                               0x3209836b -[UIApplication _receivedMemoryNotification] + 174
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	24  libdispatch.dylib                   0x30efb259 _dispatch_source_invoke + 516
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	25  libdispatch.dylib                   0x30ef8b25 _dispatch_queue_invoke$VARIANT$up + 48
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	26  libdispatch.dylib                   0x30ef8e6b _dispatch_main_queue_callback_4CF$VARIANT$up + 158
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	27  CoreFoundation                      0x34e9b2ad __CFRunLoopRun + 1268
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	28  CoreFoundation                      0x34e1e4a5 CFRunLoopRunSpecific + 300
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	29  CoreFoundation                      0x34e1e36d CFRunLoopRunInMode + 104
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	30  GraphicsServices                    0x3611a439 GSEventRunModal + 136
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	31  UIKit                               0x31f14e7d UIApplicationMain + 1080
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	32  GercoGap                            0x010de558 wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 240
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	33  GercoGap                            0x00049c40 GercoGap_Application_Main_string__ + 48
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	34  GercoGap                            0x0156f7dc wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	35  GercoGap                            0x016b6f04 mono_jit_runtime_invoke + 1644
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	36  GercoGap                            0x0175d448 mono_runtime_invoke + 128
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	37  GercoGap                            0x01761864 mono_runtime_exec_main + 436
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	38  GercoGap                            0x01761c24 mono_runtime_run_main + 756
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	39  GercoGap                            0x016bb28c mono_jit_exec + 140
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	40  GercoGap                            0x016b34d8 main + 1756
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: 	41  GercoGap                            0x000033b4 start + 52
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: =================================================================
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: Got a SIGABRT while executing native code. This usually indicates
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: a fatal error in the mono runtime or one of the native libraries 
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: used by your application.
Apr 17 15:44:59 unknown UIKitApplication:com.gerco.gapp[0xf9dc][5103] <Notice>: =================================================================
Comment 1 Sebastien Pouliot 2012-04-17 10:46:50 UTC
Like the exception message says an instance of `GercoGap.GapPhotoScreen` has been collected (by the garbage collector) since it had no (managed) reference inside your application. 

At some point native code tried to call back into your managed code and this caused the exception you are seeing. The solution is to keep a managed reference to your `GercoGap.GapPhotoScreen` instance as long as native code needs to use it. 

Sometimes it's as easy as to change a local variable to a type field - but that really depend on your own code. If you can attach your code (or part of it) so we can duplicate it we will be able to help you further.
Comment 3 PJ 2013-11-19 17:05:08 UTC
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?

If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
Comment 4 PJ 2013-12-05 18:35:31 UTC
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.

Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.