Adobe-Runtime-Support icon indicating copy to clipboard operation
Adobe-Runtime-Support copied to clipboard

Crash on iOS after updating to AIR SDK 51.1.3.8 — objc_msgSend in NSURLSession delegate

Open xxxVBxxx opened this issue 4 months ago • 21 comments

After updating our project from AIR SDK 50.2.3.1 to 51.1.3.8, we have observed a significant increase in crashes on iOS devices.

iOS: 18.2 macOS: 15.3.2

Occurs on production build Crash location: objc_msgSend inside NSURLSession delegate methods

The issue was not present in AIR SDK 50.2.3.1. We are using several Distriqt ANEs, but the crash appears within native iOS networking calls.

Crashlytics report com.3dtuning.Tuning3D_issue_3ceba855a8ad2d1af83655803dc13f70_crash_session_e745feb5d13b4be0bebd65fac5763a77_DNE_0_v2_stacktrace.txt

Xcode Organizer crash log 2025-08-11_14-11-08.2221_-0700-5177052606f4766c8168752056434cb7b4085612.txt

xxxVBxxx avatar Aug 12 '25 06:08 xxxVBxxx

Let me know if you think it's in the extensions @ajwfrost but I didn't think they are from the logs.

marchbold avatar Aug 12 '25 06:08 marchbold

@ajwfrost is there any data that I can provide?

xxxVBxxx avatar Aug 14 '25 11:08 xxxVBxxx

Hi

This is a problem sending a message within the didCompleteWithError callback in the NSURLSession delegate...

0  libobjc.A.dylib                0x1c20 objc_msgSend + 32
1  3DTuning                       0x321194 main + 2241632
2  3DTuning                       0x32157c main + 2242632
3  CFNetwork                      0x23200 __79-[__NSCFURLSessionDelegateWrapper task:didCompleteWithError:completionHandler:]_block_invoke + 36

and it looks to me like this is the same as an issue we had fixed recently, as part of #3804 (see one of the items under https://airsdk.harman.com/release_notes?q=3804).

Are you able to update to the latest SDK as I think that should help?

thanks

ajwfrost avatar Aug 15 '25 10:08 ajwfrost

@ajwfrost I used the latest AIR SDK for a test build and it did crash. The crash happened while the app was minimized and not in active use. I’m attaching the crash log from the device and the Crashlytics crash log as well. I hope this is helpful.

com.3dtuning.Tuning3D_issue_3ceba855a8ad2d1af83655803dc13f70_crash_session_7b50898ad6624524858b1478118e06ff_DNE_0_v2_stacktrace.txt

3DTuning-2025-08-21-150346.txt

xxxVBxxx avatar Aug 21 '25 12:08 xxxVBxxx

Hello @ajwfrost ,

I have built the app using the latest AIR SDK (51.2.2.3), but unfortunately the issue still persists. The same type of crash remains at the top of the reports.

I’m attaching the logs from Crashlytics and Xcode for the latest build of the app. Hopefully this information will be helpful in diagnosing the problem.

Thank you for your support.

com.3dtuning.Tuning3D_issue_3ceba855a8ad2d1af83655803dc13f70_crash_session_c90115314b5e42a68f65a207d4274560_DNE_0_v2_stacktrace.txt

XCode crash log CtmqOq3nI5xQFu6d3a8IC1.zip

xxxVBxxx avatar Aug 25 '25 07:08 xxxVBxxx

@ajwfrost I wanted to follow up on the crash issue I shared earlier. In the logs, the crash occurs on the com.apple.NSURLSession-delegate thread with objc_msgSend, which looks like a message is being sent to a released or invalid object.

Since our app makes use of URLLoader, URLStream, Loader, and similar AS3 classes for network and content loading, I wanted to ask whether incorrect usage or disposal of these classes could potentially lead to this type of crash

xxxVBxxx avatar Aug 25 '25 08:08 xxxVBxxx

Hello @ajwfrost, I wanted to follow up regarding the iOS crash issue I reported earlier. Is there any additional information or logs we can provide to help identify the cause?

This issue is quite urgent for us, as the number of crashes on iOS devices has increased by about 10x recently.

Thank you for your support

Tuning3DT avatar Aug 26 '25 06:08 Tuning3DT

I’m experiencing the same issue. @premiumsB also confirmed the crash problem yesterday and it's related to https://airsdk.harman.com/release_notes?q=3804

httpwebmedia avatar Aug 26 '25 08:08 httpwebmedia

@xxxVBxxx I have the same issue since the last 18 months. I really hope Andrew can fix that problem because my downloads drop if I update an apps with lots of crashes. Do you use adverts for admob? We noticed that @udmv and @fliplinestudio doesn't have this problem and they don't use Admob/Adverts ANE.

premiumsB avatar Aug 26 '25 13:08 premiumsB

I released an update for AdMob yesterday, if you think it may be related to that, could be worth grabbing the update.

marchbold avatar Aug 26 '25 23:08 marchbold

@xxxVBxxx I have the same issue since the last 18 months. I really hope Andrew can fix that problem because my downloads drop if I update an apps with lots of crashes. Do you use adverts for admob? We noticed that @udmv and @fliplinestudio doesn't have this problem and they don't use Admob/Adverts ANE.

Yes, I do use Adverts for Admob and I suspect it caused by interstitial and rewarded ads

Tuning3DT avatar Aug 27 '25 06:08 Tuning3DT

I released an update for AdMob yesterday, if you think it may be related to that, could be worth grabbing the update.

Thanks @marchbold , I’ll include the updated AdMob in our next production build and let you know if the crash still occurs.

Tuning3DT avatar Aug 27 '25 06:08 Tuning3DT

@marchbold We've been experiencing this issue for some time. Have you updated Advert specifically to address the libobjc problem? We are now like 6 developpers who think that that the issue we've been facing for about 18 months is connected to the Adverts ANE.

premiumsB avatar Aug 27 '25 14:08 premiumsB

Weirdly, I'm sure I replied on this thread yesterday but my reply doesn't seem to be here? Maybe I had forgotten to hit the 'comment' button...

But in terms of the objc_msgSend problem, that should have been address in AIR 51.2.2.2. It might have been something that was exposed by some other behaviour but the actual crash was due to some non-thread-safe code within the AIR runtime.

For the other issue mentioned by @Tuning3DT / @xxxVBxxx in the call stack with the long filename: can you please rebuild with the option to generate the symbol output (see https://airsdk.harman.com/support#ipa_symbols) and send us that file along with the crash call stack or IPS file?

thanks

ajwfrost avatar Aug 27 '25 15:08 ajwfrost

@xxxVBxxx I'd missed your query earlier, sorry:

Since our app makes use of URLLoader, URLStream, Loader, and similar AS3 classes for network and content loading, I wanted to ask whether incorrect usage or disposal of these classes could potentially lead to this type of crash

It shouldn't make any difference what is done on the AS3 side of things, we should always be able to protected against a situation where objects are no longer available. In this particular case, at least the issue that we thought was being hit here, it was similar to an earlier update where a callback is triggered, we dispatch an event to the core runtime to notify ActionScript, and then we do some clean-up - and the crash happens during the clean-up. It appeared to be that if the other thread had already handled that event pretty quickly, then the background thread's clean-up would try to call a method on an Objective-C object that's just been deleted by the main/UI thread.

So, that should no longer be possible, so I'm puzzled by the other issue (#3804) where this seems to still be happening..

ajwfrost avatar Aug 27 '25 15:08 ajwfrost

@premiumsB The update was just to the latest AdMob SDK, (on iOS this went from 12.6.0 to 12.9.0). There is nothing in our extension code that could cause this (ie. we don't do any url sessions) but there likely are calls internal to the AdMob SDK that do.

However I can't find any other developers reporting a similar issue with AdMob so I'm not sure it's directly related here.

marchbold avatar Aug 27 '25 23:08 marchbold

Weirdly, I'm sure I replied on this thread yesterday but my reply doesn't seem to be here? Maybe I had forgotten to hit the 'comment' button...

But in terms of the objc_msgSend problem, that should have been address in AIR 51.2.2.2. It might have been something that was exposed by some other behaviour but the actual crash was due to some non-thread-safe code within the AIR runtime.

For the other issue mentioned by @Tuning3DT / @xxxVBxxx in the call stack with the long filename: can you please rebuild with the option to generate the symbol output (see https://airsdk.harman.com/support#ipa_symbols) and send us that file along with the crash call stack or IPS file?

thanks

@ajwfrost I also included the dSYM file just in case. https://drive.google.com/file/d/1KDAofzy-KAE-j0AsLLuswAsaOWExh52C/view?usp=sharing

xxxVBxxx avatar Aug 28 '25 06:08 xxxVBxxx

@marchbold @ajwfrost I have the same issue with air sdk 51.1.3.10, ipa built on mac os.

The ANEs I used for the built: ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] └──[email protected]

Also with another app built with air sdk 51.2.1.5, ANES: ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] ├──[email protected] └──[email protected]

httpwebmedia avatar Aug 29 '25 13:08 httpwebmedia

FYI we are seeing the objc_msgSend issue still with 51.2.2.2 which we thought should be protected against. There are a few other objc calls happening within the offending function so it might be a different issue to what we'd first thought.

We're going to review those again but for the short term we're going to split the function into multiple other functions, which means a future call stack should then help to narrow down the problem! We're just in time to do this before the 51.2.2.4 release that we are aiming to put out towards the end of next week.

I am wondering if the surge in these issues might be down to some change in the URL handling or behaviour in the advertisement SDKs, but the actual failure is within the AIR runtime so it something we should be fixing internally..

thanks

ajwfrost avatar Aug 29 '25 16:08 ajwfrost

FYI we are seeing the objc_msgSend issue still with 51.2.2.2 which we thought should be protected against. There are a few other objc calls happening within the offending function so it might be a different issue to what we'd first thought.

We're going to review those again but for the short term we're going to split the function into multiple other functions, which means a future call stack should then help to narrow down the problem! We're just in time to do this before the 51.2.2.4 release that we are aiming to put out towards the end of next week.

I am wondering if the surge in these issues might be down to some change in the URL handling or behaviour in the advertisement SDKs, but the actual failure is within the AIR runtime so it something we should be fixing internally..

thanks

Hello @ajwfrost , I’ve shipped a production build compiled with 51.2.2.4, but unfortunately the crashes are still occurring. The amount of crashes has not decreased compared to builds made with 51.2.2.2 and 51.2.2.3.

I’m attaching the latest crash log for your review. Some of them include a crash_info_entry_0 key. Please let me know if you’d like me to provide additional details. Thanks.

crash_info_entry_0: 52204: CFNetwork internal error (0xc01a:/Library/Caches/com.apple.xbs/Sources/CFNetwork/Loading/Connection/Loader Side/URLConnectionLoader.cpp:261)

com.3dtuning.Tuning3D_issue_3ceba855a8ad2d1af83655803dc13f70_crash_session_42e8596e12274fff936b539a24d615b1_DNE_0_v2_stacktrace.txt

crash_info_entry_0: 441: CFNetwork internal error (0xc01a:/Library/Caches/com.apple.xbs/Sources/CFNetwork/Loading/Connection/Loader Side/URLConnectionLoader.cpp:261) com.3dtuning.Tuning3D_issue_3ceba855a8ad2d1af83655803dc13f70_crash_session_d0754e4709df443494d680f9e87b5148_DNE_0_v2_stacktrace.txt

But the most of them don't have crash_info_entry_0 key or any other key com.3dtuning.Tuning3D_issue_3ceba855a8ad2d1af83655803dc13f70_crash_session_c5c9a13cb572462c890acc5a8dfbe6c8_DNE_0_v2_stacktrace.txt

Tuning3DT avatar Sep 16 '25 06:09 Tuning3DT

Hi @ajwfrost , I just wanted to kindly follow up on this issue. I wrote earlier and I’m still experiencing the problem. Please let me know if you need any more details from my side. Thanks a lot for your time and support!

Tuning3DT avatar Sep 24 '25 11:09 Tuning3DT