Skip to content

EXC_BAD_ACCESS (KERN_INVALID_ADDRESS) UnityGfxDeviceWorker Crash on iOS #1968

@georgemarkosian

Description

@georgemarkosian

Describe the issue

We've been using AVPro in our app since the beginning of development in 2021. We used 2.9.* version and recently purchased and updated to 3.0.6. Now the app is live and we have about 13k DAU, with 2.3K DAU on iOS.

The current live version of the app is 1.2.6, but since 1.0.6 version, which was released about 2 years ago, we had the following 3 errors in the top 3 of our Firebase Crashlytics:

objc_retain
EXC_BAD_ACCESS (KERN_INVALID_ADDRESS)
~446 users per 30 days

objc_msgSend
EXC_BAD_ACCESS (KERN_INVALID_ADDRESS)
~272 users per 30 days

objc_retain_x0
EXC_BAD_ACCESS (KERN_INVALID_ADDRESS)
~100 users per 30 days

As we can see on the stack trace, all 3 errors relate to the AVPro plugin. Our QA team can't reproduce these errors on our test devices and these errors appear only on our production application.

On August 10 we released a new version of the app (1.2.6) with 3.0.6 version of the AVPro plugin hoping it would resolve the issue but noticed a small spike in these errors instead.

These errors significantly drop our crash-free users/session stats.

Your Setup:

  • Unity version: 2022.3.40 with multithreaded rendering enabled
  • AVPro Video version: 3.0.6 Core
  • Operating system version: iOS
  • Device model: iPhones (from 6s Plus to 15 Pro Max), iPads (Pad Pro 12.9, Pad Pro 11)
  • Video specs: streaming from Vimeo, 1024p, 720p, ~10mins videos

To Reproduce
Most of the users get it in the first session while closing a UI component with the video player. Looks like it occurs when the video player is disposing. We can't reproduce this on our test devices.

Logs
This stack trace is from one of the crash reports, but nearly all of them look like this:

Crashed: UnityGfxDeviceWorker
0  libobjc.A.dylib                0x1468 objc_retain + 16
1  libobjc.A.dylib                0x1468 objc_retain_x0 + 16
2  UnityFramework                 0x3df66a8 AVPPluginGetRenderEventFunction + 160
3  UnityFramework                 0x3198d54 GfxDevice::InsertCustomMarkerCallbackAndDataWithFlags(void (*)(int, void*), int, CustomMarkerCallbackFlags, void*, unsigned long) + 2583 (GfxDevice.cpp:2583)
4  UnityFramework                 0x32df2a8 GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&) + 1534 (GfxDeviceWorker.cpp:1534)
5  UnityFramework                 0x3360888 GfxDeviceWorkerAutoreleasePoolProxy + 5824 (GfxDeviceMetal.mm:5824)
6  UnityFramework                 0x32d7870 GfxDeviceWorker::RunExt(ThreadedStreamBuffer&) + 375 (GfxDeviceWorker.cpp:375)
7  UnityFramework                 0x32d741c GfxDeviceWorker::RunGfxDeviceWorker(void*) + 333 (GfxDeviceWorker.cpp:333)
8  UnityFramework                 0x2cebb6c Thread::RunThreadWrapper(void*) + 112 (Thread.cpp:112)
9  libsystem_pthread.dylib        0x606c _pthread_start + 136
10 libsystem_pthread.dylib        0x10d8 thread_start + 8

We're happy to share all the data we have to debug this. We can also grant access to Crashlytics reports if that helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    iOSiOS platform

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions