Giphy / giphy-ios-sdk

Home of the GIPHY SDK iOS example app, along with iOS SDK documentation, issue tracking, & release notes.
https://developers.giphy.com/
Mozilla Public License 2.0
111 stars 51 forks source link

[Crash] Attempting to address object pointer with invalid tag #252

Open xmollv opened 1 month ago

xmollv commented 1 month ago

🐛 Bug Report

We've been observing a crash, but we're not very clear on why it happens. The crash is the following:

SIGTRAP : Attempting to address object pointer with invalid tag
Queue 7645: com.gphpersistence.saveQueue

Thread 11 Queue 7645: com.gphpersistence.saveQueue (serial) [Crashed]:

0    CoreFoundation                           0x19d32014c     CFGetTypeID.cold.1 + 16
1    CoreFoundation                           0x19d180e58     CFGetTypeID + 239
2    CoreFoundation                           0x19d1c2420     __CFPropertyListIsValidAux + 59
3    CoreFoundation                           0x19d1e4694     CFPropertyListWrite + 91
4    CoreFoundation                           0x19d1e439c     CFPropertyListCreateData + 143
5    Foundation                               0x19c0ed74c     +[NSPropertyListSerialization dataWithPropertyList:format:options:error:] + 51
6    GiphyUISDK                               0x1047c1b44     0x10473c000
7    GiphyUISDK                               0x10475baa0     0x10473c000
8    libdispatch.dylib                        0x1a509013c     _dispatch_call_block_and_release + 31
9    libdispatch.dylib                        0x1a5091dd4     _dispatch_client_callout + 19
10   libdispatch.dylib                        0x1a5099400     _dispatch_lane_serial_drain + 747
11   libdispatch.dylib                        0x1a5099f30     _dispatch_lane_invoke + 379
12   libdispatch.dylib                        0x1a50a4cb4     _dispatch_root_queue_drain_deferred_wlh + 287
13   libdispatch.dylib                        0x1a50a4528     _dispatch_workloop_worker_thread + 403
14   libsystem_pthread.dylib                  0x1fa043934     _pthread_wqthread + 287
15   libsystem_pthread.dylib                  0x1fa0400cc     start_wqthread + 7

I can't get you the symbolicated crash logs because we have the GiphySDK as a dependency to an internal SPM package, and apparently there's a limitation on SPM <> Xcode where the dSYMs are not generated if the SPM package is not explicitly defined as .dynamic, which we can't change at this very moment (I understand that this is far from ideal). See:

To Reproduce

Unknown, but seems related to serializing the last used gifs to be displayed later on. It seems to happen right once the user selects a GIF and we receive the GiphyDelegate callback GiphyDelegate.didSelectMedia(giphyViewController:media:).

Screenshot 2024-08-05 at 10 25 08 Screenshot 2024-08-05 at 10 25 29

Expected behavior

SDK doesn't crash.

Actual Behavior

Sometimes the SDK does crash.

Your Environment

Reproducible Demo

N/A

leschlogl commented 3 weeks ago

Hey @xmollv,

Thank you for flagging this. We'll look into it and get back to you soon.

msrutek-paylocity commented 5 days ago

Hello @leschlogl any update on this? We're seeing the same crash.

leschlogl commented 5 days ago

Hi @msrutek-paylocity and @xmollv,

We were able to reproduce and fix the issue. It should be included in the next release. It should be released this or in the next week.