question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[iOS] Rarely crashes at the timing of objc_msgSend()

See original GitHub issue

[REQUIRED] Step 1: Describe your environment

  • Unity version: 2021.3.6f1
  • Google Mobile Ads Unity plugin version: GoogleMobileAds-v7.1.0
  • Platform: iOS
  • Platform OS version: iOS 15.5
  • Mediation ad networks used, and their versions: com.google.ads.mediation:ironsource:7.2.2.1.0 GoogleMobileAdsMediationIronSource:7.2.2.1.0 com.google.ads.mediation:facebook:6.11.0.1 GoogleMobileAdsMediationFacebook:6.11.1.0 com.unity3d.ads:unity-ads:4.2.1 GoogleMobileAdsMediationUnity:4.2.1.0

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur? Rarely crashes at the timing of objc_msgSend(). The cause is unknown, but I believe the crash occurs when it is called repeatedly. In my game, if an ad cannot be retrieved, it tries to retrieve it once every 5 seconds.

An excerpt of my code

void OnAdFailedToLoad(object sender, AdFailedToLoadEventArgs e)
{
    waitingTimeIfAdDoesNotLoad = 5;
    Debug.LogWarning("Reward ad failed to show with error: "+ e.LoadAdError.GetMessage());
}

void Update()
{
    if (waitingTimeIfAdDoesNotLoad <= 0)
    {
        return;
    }

    waitingTimeIfAdDoesNotLoad -= Time.deltaTime;
    if (waitingTimeIfAdDoesNotLoad <= 0)
    {
        if (!IsLoaded())
        {
            StartLoadAd();
        }
    }
}

iOS Clash Report

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000e8d6d499c370 -> 0x00000056d499c370 (possible pointer authentication failure)
Exception Codes: 0x0000000000000001, 0x0000e8d6d499c370
VM Region Info: 0x56d499c370 is in 0x1000000000-0x7000000000;  bytes after start: 304214557552  bytes before end: 108102302863
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      commpage (reserved)      fc0000000-1000000000 [  1.0G] ---/--- SM=NUL  ...(unallocated)
--->  GPU Carveout (reserved) 1000000000-7000000000 [384.0G] ---/--- SM=NUL  ...(unallocated)
      UNUSED SPACE AT END
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Kernel Triage:
VM - Compressor failed a blocking pager_get
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - Compressor failed a blocking pager_get

Thread 0 name:
Thread 0 Crashed:
0   libobjc.A.dylib               	0x00000001a2c12f40 objc_msgSend + 32 (:-1)
1   UnityFramework                	0x000000010c3ee644 GADUGetAdErrorMessage + 24
2   UnityFramework                	0x000000010d4f4844 0x10afec000 + 38832196
3   UnityFramework                	0x000000010c4c0c54 0x10afec000 + 21843028 (Assembly-CSharp.cpp:15723)
4   UnityFramework                	0x000000010c54b1a4 0x10afec000 + 22409636
5   UnityFramework                	0x000000010c3a42ac il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) + 100 (Runtime.cpp:576)
6   UnityFramework                	0x000000010c3a40fc 0x10afec000 + 20676860 (Runtime.cpp:562)
7   UnityFramework                	0x000000010b7bf700 scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) + 112 (ScriptingApi_Il2Cpp.cpp:292)
8   UnityFramework                	0x000000010b7ce364 0x10afec000 + 8266596 (ScriptingInvocation.cpp:298)
9   UnityFramework                	0x000000010b7dea94 0x10afec000 + 8333972
10  UnityFramework                	0x000000010b587b98 0x10afec000 + 5880728
11  UnityFramework                	0x000000010b587a64 BehaviourManager::Update() + 36 (Behaviour.cpp:173)
12  UnityFramework                	0x000000010b659f68 0x10afec000 + 6741864 (Player.cpp:1605)
13  UnityFramework                	0x000000010b65ab6c ExecutePlayerLoop(NativePlayerLoopSystem*) + 100 (PlayerLoop.cpp:383)
14  UnityFramework                	0x000000010b65abac 0x10afec000 + 6745004 (PlayerLoop.cpp:404)
15  UnityFramework                	0x000000010b65ae94 0x10afec000 + 6745748 (PlayerLoop.cpp:508)
16  UnityFramework                	0x000000010be1aaf4 UnityPlayerLoopImpl(bool) + 116 (LibEntryPoint.mm:327)
17  UnityFramework                	0x000000010b0069f8 0x10afec000 + 109048
18  UnityFramework                	0x000000010b006960 -[UnityAppController(Rendering) repaintDisplayLink] + 108 (UnityAppController+Rendering.mm:71)
19  QuartzCore                    	0x000000018dbe0d40 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 748 (CADisplay.mm:4175)
20  QuartzCore                    	0x000000018dbe7d70 display_timer_callback(__CFMachPort*, void*, long, void*) + 372 (CADisplayTimer.cpp:219)
21  CoreFoundation                	0x0000000189e9ebf0 __CFMachPortPerform + 176 (CFMachPort.c:549)
22  CoreFoundation                	0x0000000189ee2258 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 60 (CFRunLoop.c:1996)
23  CoreFoundation                	0x0000000189ee5a64 __CFRunLoopDoSource1 + 604 (CFRunLoop.c:2136)
24  CoreFoundation                	0x0000000189e9f664 __CFRunLoopRun + 2372 (CFRunLoop.c:3172)
25  CoreFoundation                	0x0000000189eb2bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
26  GraphicsServices              	0x00000001a5fe6374 GSEventRunModal + 164 (GSEvent.c:2200)
27  UIKitCore                     	0x000000018c822648 -[UIApplication _run] + 1100 (UIApplication.m:3511)
28  UIKitCore                     	0x000000018c5a3d90 UIApplicationMain + 364 (UIApplication.m:5064)
29  UnityFramework                	0x000000010b006434 -[UnityFramework runUIApplicationMainWithArgc:argv:] + 108 (main.mm:96)
30  ProductName                   	0x00000001047bbe00 main + 68 (main.mm:26)
31  dyld                          	0x0000000104b4dce4 start + 520 (dyldMain.cpp:879)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
NVentimigliacommented, Jul 29, 2022

Hi @IShix-g,

Thanks for the report. We have verified to the issue and will patch it shortly.

0reactions
NVentimigliacommented, Mar 21, 2023

Closing, this will be fixed next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS objc_msgSend crash, with no report or warning given
I am testing my app out, pushing it pretty hard, and I'm getting it to crash (black screen, image doesn't save, drops back...
Read more >
Objective-C Runtime | Apple Developer Forums
I ran across the following crash while using one of our apps. The app crashes since the recent iOS 17 beta builds. The...
Read more >
iOS 16 Crash - [UIView bounds] + 32
Crashing early in objc_msgSend is usually an indication that you have a bad object of some kind. If I'm reading the assembly correctly,...
Read more >
Dissecting objc_msgSend on ARM64
Objective-C's solution to this conflict is the method cache. ... then places the result into the cache so that the next time can...
Read more >
iOS Assembly Tutorial: Understanding ARM
Learn how to read assembly in iOS – a useful skill when debugging your code or diagnosing why a crash has occurred.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found