Unity Version: 5.3.2p2

It's crashing from within Unity's internal code when doing a GameObject.SendMessage() call, it should be noted that this particular line itself is not the source of the crash (nothing in this line of code is null):

target.gameObject.SendMessage("OnPointerClick", eventData, SendMessageOptions.DontRequireReceiver);

Source file: https://gist.github.com/blaketriana/b954dd255038c2bcab5d

My best guess is that somehwere in Unity's SendMessage code, an exception occurs when it tries to find a valid target to invoke the OnPointerClick message. This would mean the crash happens before we ever invoke the OnPointerClick callback on the target and not within the body of its callback (because that would show up in the trace). It seems like I will need to open a support ticket with Unity if it's an internal problem in their code.

Let me know if there's more information I can share about my issue. Thanks all!

Stack trace:

Thread : Crashed: com.apple.main-thread
0  game-app                       0x100033770 CrashedCheckBellowForHintsWhy() (CrashReporter.mm:97)
1  game-app                       0x100cbfe10 RuntimeInvoker_Void_t2779279689_Object_t_Object_t(MethodInfo const*, void*, void**) (Il2CppInvokerTable.cpp:1128)
2  game-app                       0x101613d94 il2cpp::vm::Runtime::CallUnhandledExceptionDelegate(Il2CppDomain*, Il2CppDelegate*, Il2CppObject*) (Runtime.cpp:350)
3  game-app                       0x101613d14 il2cpp::vm::Runtime::UnhandledException(Il2CppObject*) (Runtime.cpp:433)
4  game-app                       0x100ee6ee4 ScriptingInvocation::Invoke(ScriptingException**, bool) (ScriptingInvocation.cpp:202)
5  game-app                       0x100edd0f8 MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethodIl2Cpp, ScriptingObject*, ScriptingException**) (MonoBehaviour.cpp:839)
6  game-app                       0x100edd2dc MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethodIl2Cpp, ScriptingObject*) (MonoBehaviour.cpp:859)
7  game-app                       0x100eeb920 Scripting::SendScriptingMessage(Unity::GameObject&, char const*, ScriptingObject*) (BaseObject.h:87)
8  game-app                       0x101105784 GameObject_CUSTOM_SendMessage(ReadOnlyScriptingObjectOfType<Unity::GameObject>, ICallString, ScriptingObject*, int) (UnityEngineGameObjectBindings.gen.cpp:320)
9  game-app                       0x100166628 OnboardingArrowInputBlocker_Message2dObjects_m1580627665 (Bulk_Assembly-CSharp_14.cpp:6437)
10 game-app                       0x1001660ac OnboardingArrowInputBlocker_OnPointerClick_m3735897309 (Bulk_Assembly-CSharp_14.cpp:6148)
11 game-app                       0x1009f6848 ExecuteEvents_Execute_TisObject_t_m1533897725_gshared (GenericMethods0.cpp:35043)
12 game-app                       0x1007d90e4 StandaloneInputModule_ProcessTouchPress_m2953705401 (Bulk_UnityEngine.UI_0.cpp:8133)
13 game-app                       0x1007d8d08 StandaloneInputModule_ProcessTouchEvents_m3567487943 (Bulk_UnityEngine.UI_0.cpp:7836)
14 game-app                       0x1007d8684 StandaloneInputModule_Process_m3720469665 (Bulk_UnityEngine.UI_0.cpp:7775)
15 game-app                       0x100cbfba4 RuntimeInvoker_Void_t2779279689(MethodInfo const*, void*, void**) (Il2CppInvokerTable.cpp:1072)
16 game-app                       0x1016136b0 il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppObject**) (Runtime.cpp:350)
17 game-app                       0x100ee7128 ScriptingInvocationNoArgs::Invoke(ScriptingException**) (ScriptingInvocationNoArgs.cpp:111)
18 game-app                       0x100ee70e0 ScriptingInvocationNoArgs::Invoke() (ScriptingInvocationNoArgs.cpp:95)
19 game-app                       0x100edc670 MonoBehaviour::CallUpdateMethod(int) (MonoBehaviour.cpp:456)
20 game-app                       0x100dafb38 void BaseBehaviourManager::CommonUpdate<BehaviourManager>() (Behaviour.cpp:169)
21 game-app                       0x100e97d24 PlayerLoop(bool, bool, IHookEvent*) (Player.cpp:1727)
22 game-app                       0x10110e2b0 UnityPlayerLoopImpl(bool) (LibEntryPoint.mm:239)
23 game-app                       0x10002a41c UnityRepaint (UnityAppController+Rendering.mm:236)
24 game-app                       0x10002a25c -[UnityAppController(Rendering) repaintDisplayLink] (UnityAppController+Rendering.mm:52)
25 QuartzCore                     0x186933814 CA::Display::DisplayLinkItem::dispatch() + 40
26 QuartzCore                     0x1869336c8 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 424
27 IOKit                          0x18445e1e8 IODispatchCalloutFromCFMessage + 372
28 CoreFoundation                 0x18418b1f8 __CFMachPortPerform + 180
29 CoreFoundation                 0x1841a1634 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
30 CoreFoundation                 0x1841a0d6c __CFRunLoopDoSource1 + 436
31 CoreFoundation                 0x18419eac4 __CFRunLoopRun + 1800
32 CoreFoundation                 0x1840cd680 CFRunLoopRunSpecific + 384
33 GraphicsServices               0x1855dc088 GSEventRunModal + 180
34 UIKit                          0x188f44d90 UIApplicationMain + 204
35 game-app                       0x10002455c main (main.mm:32)
36 libdyld.dylib                  0x183c6e8b8 start + 4
  • \$\begingroup\$ SendMessage should be avoided as much as possible, because it is too slow. It can noticeably decrease the performance of your game. \$\endgroup\$ – S. Tarık Çetin Feb 23 '16 at 0:25
  • \$\begingroup\$ Is the "OnboardingArrowInputBlocker_OnPointerClick_m3735897309 (Bulk_Assembly-CSharp_14.cpp:6148)" bit ('line' 10) not your callback? Or is the approach here something more like "In some object's OnPointerClick, I pass another OnPointerClick message to a different object"? \$\endgroup\$ – Chris Mills-Price Feb 23 '16 at 0:47
  • \$\begingroup\$ Did you implement any delegate without if check? Or call invoke method with wrong string (method) name? Double check these points \$\endgroup\$ – Hamza Hasan Feb 23 '16 at 3:42
  • \$\begingroup\$ Added my source file to the the question to add more info. \$\endgroup\$ – James Linden Feb 24 '16 at 1:50
  • \$\begingroup\$ @ChrisMills-Price "OnboardingInputBlocker" is just a large Image component that blocks all input to other UI elements on screen. I implemented OnPointerClick to receive those mouse Raycasts and selectively redistribute them to a particular target (it's used for tutorial arrows). Checking the source I just added will make it clearer. \$\endgroup\$ – James Linden Feb 24 '16 at 1:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.