Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes on iOS #9

Open
TonSharp opened this issue Aug 26, 2024 · 10 comments
Open

Crashes on iOS #9

TonSharp opened this issue Aug 26, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@TonSharp
Copy link
Contributor

I'm observing a several iOS crashes

This one is reproducible on iOS 15. Devices: iPhone 6s, 7, 7 Plus

Crashed: Job.Worker 0
0  libsystem_platform.dylib       0x1c2c __bzero + 28
1  UnityFramework                 0x5db3a94 rlottie::internal::renderer::Composition::render(rlottie::Surface const&) + 924
2  UnityFramework                 0x5de3420 lottie_animation_render_aspect + 136
3  UnityFramework                 0x4d6d2e8 ExecuteJob(ManagedJobData*, void (*)(void*, void*, void*, void*, int), int, unsigned char*) + 1156 (JobsBindings.cpp:1156)
4  UnityFramework                 0x4d6c8fc ForwardJobToManaged(ManagedJobData*) + 1440 (JobsBindings.cpp:1440)
5  UnityFramework                 0x4d6a8b8 ujob_execute_job(ujob_control_t*, ujob_lane_t*, ujob_job_t*, ujob_handle_t, unsigned int) + 972 (ujobs.cpp:972)
6  UnityFramework                 0x4d6ab74 lane_guts(ujob_control_t*, ujob_lane_t*, int, int) + 1146 (ujobs.cpp:1146)
7  UnityFramework                 0x4d6b62c worker_thread_routine(void*) + 1157 (ujobs.cpp:1157)
8  UnityFramework                 0x4e3a0c8 Thread::RunThreadWrapper(void*) + 112 (Thread.cpp:112)
9  libsystem_pthread.dylib        0x3338 _pthread_start + 116
10 libsystem_pthread.dylib        0x1938 thread_start + 8

And this one reproducible on iOS 14, 15 and iPadOS 16. Devices: iPhone 6s, 7, 7 Plus, iPad Pro

Crashed: Job.Worker 0
0  UnityFramework                 0x5de33c0 lottie_animation_render_aspect + 40
1  UnityFramework                 0x4d6d2e8 ExecuteJob(ManagedJobData*, void (*)(void*, void*, void*, void*, int), int, unsigned char*) + 1156 (JobsBindings.cpp:1156)
2  UnityFramework                 0x4d6d2e8 ExecuteJob(ManagedJobData*, void (*)(void*, void*, void*, void*, int), int, unsigned char*) + 1156 (JobsBindings.cpp:1156)
3  UnityFramework                 0x4d6c8fc ForwardJobToManaged(ManagedJobData*) + 1440 (JobsBindings.cpp:1440)
4  UnityFramework                 0x4d6a8b8 ujob_execute_job(ujob_control_t*, ujob_lane_t*, ujob_job_t*, ujob_handle_t, unsigned int) + 972 (ujobs.cpp:972)
5  UnityFramework                 0x4d6ab74 lane_guts(ujob_control_t*, ujob_lane_t*, int, int) + 1146 (ujobs.cpp:1146)
6  UnityFramework                 0x4d6b62c worker_thread_routine(void*) + 1157 (ujobs.cpp:1157)
7  UnityFramework                 0x4e3a0c8 Thread::RunThreadWrapper(void*) + 112 (Thread.cpp:112)
8  libsystem_pthread.dylib        0x3338 _pthread_start + 116
9  libsystem_pthread.dylib        0x1938 thread_start + 8
@gilzoide
Copy link
Owner

Hey @TonSharp, thanks for reporting this in a brand new issue.
Say, can you reproduce it yourself? Does it happen always or only some times? Any more information other than this stack trace and iOS versions?

@TonSharp
Copy link
Contributor Author

Unfortunately I don't have an iOS device handy and can't reproduce this crash right now. I will ask the testers in my team to look at the build on a 7 iPhone and I will write you back soon

@TonSharp
Copy link
Contributor Author

TonSharp commented Sep 3, 2024

@gilzoide Hello again! I have been researching app crashes on iPhone 7 with my team for some time. I can say that they happen periodically. One of the steps that leads to a 100% crash is to start playing the lottie animation right after launch. If you wait about 5-7 seconds after startup, then everything as far as I can see works stably

@gilzoide
Copy link
Owner

gilzoide commented Sep 3, 2024

One of the steps that leads to a 100% crash is to start playing the lottie animation right after launch.

Hmm, weird huh. But 100% reproductivity is good, makes it easier to debug.
Maybe there's some race condition in the code 🤔 I can see in ImageLottiePlayer some places that should definitely complete the _renderJobHandle just to make sure nothing is running concurrently.

Maybe there's some issue on low memory as well, if your app loads too much stuff right away and only releases afterwards in these 5~7s, I don't know. Did you see if you are receiving low memory messages in these devices?

By the way, are using the ImageLottiePlayer component or running animations manually?

@TonSharp
Copy link
Contributor Author

TonSharp commented Sep 3, 2024

I don't receive the low memory message. I am using ImageLottiePlayer with Auto Play turned off, and at the right time through the code I call the Unpause() method

@STak4
Copy link

STak4 commented Mar 17, 2025

@gilzoide
I have the same issue.
It's fine for normal use, but issues happen when switching AnimationAssets at runtime.
I created a sample. Can you check this repo?
Scene is "RuntimeSet.unity"

Please refer:How to crash

@gilzoide
Copy link
Owner

Thanks for the reproduction project @STak4, I'll try looking into it in the weeked.

@gilzoide
Copy link
Owner

Hey folks, so I was able to reproduce a crash using the sample scene provided by STak4. From the stacktrace, I'm quite sure the crash happens because of race conditions between the render job and the main thread. The fix is in branch bugfix/crash-render-job, please test it out and tell me if it fixes the problem.

@STak4
Copy link

STak4 commented Mar 24, 2025

@gilzoide
Yes, the iOS issue is fixed. Thank you for the fix!
But it seems that there is still a crash issue with retrying in Editor.
I couldn't get any useful logs from Editor.log.

Please refer video.
https://github.com/user-attachments/assets/a98f5f1e-d490-406d-a5f7-87e6dcc05a11

@gilzoide
Copy link
Owner

Yes, the iOS issue is fixed. Thank you for the fix!

Nice, no problem!

But it seems that there is still a crash issue with retrying in Editor.

Oh no =/
Maybe there's some problem with the OnValidate flow, which happens only in the Editor... Thanks for the video, it helps knowing how to reproduce the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants