I got a Crashlog which is related to Lottie,
But It has a very small probability of occurrence.
How can I fix it.
Thread 9 name: WebThread
Thread 9 Crashed:
0 libobjc.A.dylib 0x0000000180c6db90 objc_msgSend + 16
1 CoreFoundation 0x00000001814dc618 -[__NSCFNumber isEqualToNumber:] + 28
2 CoreFoundation 0x00000001814dc5d0 -[__NSCFNumber isEqual:] + 72
3 0x000000010114be28 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] (LOTAnimatorNode.m:41)
4 0x000000010115ba14 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] (LOTRenderGroup.m:137)
5 0x000000010115ba14 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] (LOTRenderGroup.m:137)
6 0x0000000101156c10 -[LOTLayerContainer displayWithFrame:forceUpdate:] (LOTLayerContainer.m:239)
7 0x0000000101150004 -[LOTCompositionContainer displayWithFrame:forceUpdate:] (LOTCompositionContainer.m:86)
8 0x0000000101150004 -[LOTCompositionContainer displayWithFrame:forceUpdate:] (LOTCompositionContainer.m:86)
9 0x00000001011569f8 -[LOTLayerContainer display] (LOTLayerContainer.m:214)
10 QuartzCore 0x00000001840dd814 CA::Layer::display_if_needed(CA::Transaction) + 228
11 QuartzCore 0x00000001840dd500 CA::Layer::layout_and_display_if_needed(CA::Transaction) + 44
12 QuartzCore 0x00000001840dcb24 CA::Context::commit_transaction(CA::Transaction) + 252
13 QuartzCore 0x00000001840dc86c CA::Transaction::commit() + 512
14 QuartzCore 0x00000001840d5dd8 CA::Transaction::observer_callback(__CFRunLoopObserver, unsigned long, void) + 80
15 CoreFoundation 0x00000001815ac7b0 _CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION_ + 32
16 CoreFoundation 0x00000001815aa554 __CFRunLoopDoObservers + 372
17 CoreFoundation 0x00000001814d4d30 CFRunLoopRunSpecific + 416
18 WebCore 0x00000001854be558 RunWebThread(void) + 456
19 libsystem_pthread.dylib 0x000000018125bb28 _pthread_body + 156
20 libsystem_pthread.dylib 0x000000018125ba8c _pthread_body + 0
21 libsystem_pthread.dylib 0x0000000181259028 thread_start + 4
I got this crash too, my version is 2.0.5, iPhone 6P, iOS 10.3
Looks like you are doing something with a LOTAnimationView from a web thread. CALayer and UIKit should never be called from any thread other than the main thread, or this crash will happen.
Mind sharing the code so I can help you debug?
- (void)playFromFrame:(nonnull NSNumber *)fromStartFrame
toFrame:(nonnull NSNumber *)toEndFrame
withCompletion:(nullable LOTAnimationCompletionBlock)completion {
if (![NSThread isMainThread]) {
NSLog(@"------");
}
...
}
I set a breakPoint in this case, and log something to see if I call this method in other thread.But breakPoint never reach. that means this method is called in main thread. However, [LOTLayerContainer display] can also invoke in WebThread.
I wrote a demo which Contains two controllers A and B.
ControllerA has a Lottie AnimationView and playing in main thread.
ControllerB contain a webView.
When the ControllerA present ControllerB.
Then dismiss ControllerB returns to ControllerA
This will cause the method:
That is very strange!
If the webview is remove then the crash doesnt happen?
@whlpkk are you using a webview somewhere too? Also the display functions can be called from things other than:
playFromFrame:(nonnull NSNumber *)fromStartFrame
toFrame:(nonnull NSNumber *)toEndFrame
withCompletion:(nullable LOTAnimationCompletionBlock)completion
Looking at the stack trace it seems as if the display function is actually being called from inside of a normal layoutSubviews block, not directly from an animation.
Im researching similar crashes and found some leads here
https://stackoverflow.com/questions/26892268/webcore-crash-log
https://bugs.webkit.org/show_bug.cgi?id=138961
Even an issue that is nearly identical on another open source repo
https://github.com/ionic-team/ionic/issues/12103
This may be an apple bug, but im going to dig a bit deeper to make sure.
@rockleeee Im trying to recreate your demo and I cannot get it to crash!
What version of the simulator are you on? Are you loading a specific page in the webview?
This does not necessarily cause a crash but will result in UI operations that are not in the main thread.
my case like @rockleeee, I first run my code on iphone6 plus, iOS 9.3. It don't crash but display functions sometimes called not in the main thread. Then, I run my code in another mobile, iphone6 plus, iOS 10.3. It often crash.
@rockleeee @whlpkk if you remove webviews does it crash?
Im just trying to get a reproduction of the crash so I can help you debug.
@buba447 I remove my webviews, it don't crash. But my lottieView don't have hierarchical relationship with webview.It should be not a bug. Thank you.
@whlpkk It should not, but it appears to have some affect. I cant imagine why a webthread would be calling display on a LOTAnimationView.
Still trying to debug but I without getting the crash to happen while connected to a debugger all potential solutions are entirely theoretical.
If you find a way to reliably reproduce please let me know!
My current theory is that the topmost layer, the animationView's compositionLayer has a presentation layer with dereferenced properties. Its being called out of sync because of some sort of layout engine response that webcore does when removing its view. The bad property currentTime is being passed down into lottie and then when lottie tries to use it, it crashes.
In our production app we are also seeing this crash, but in less than 1 percent of the time, so its hard to get a hold of.
I cant exactly prove this, but I can put in failsafes that might fix the crash, the also could not fix them.
If either of you know how to get a more solid reproduction, that would be super helpful.
Currently Im trying two view controllers, A with an animation that is plyaing on loop. It has autoresizing masks turned on. B is a viewcontroller with a webview, loading up airbnb.com.
Quickly shuffling between them hasnt done anything for me yet.
I think i found a fix! Can you pull master and check?
I also did not find the path that would lead to a crash
I will try to update and check
@buba447 I pull master(2.1.3) and check, it don't take effect. I still can run in webthread and crash. My webview and lottieView don't have direct hierarchical relationship. I will degrade to 1.5.2 for a while.
@whlpkk Do you mind sharing the code that makes the crash?
@buba447 my project can't share. It also too complex
to separate the code. I write a simple demo which can lead display function run in webthread,but not crash.Do you need? you can reproduce by keep clicking screen quickly when webview loadding.
lottieDemo.zip
@whlpkk I tried your demo and I see that its running off thread, but the crash isnt happening?
If i could recreate the crash I could try to fix it. Unfortunately I havent seen the crash yet.
If you know how to make the crash happen, please let me know.
Yes, my demo can't crash. CALayer and UIKit should never be called from any thread other than the main thread, however, It run in webThread. I hope you can fix this bug.
CAlayer and UIKit are apparently called from the webthread all of the time, outside of Lottie. This is a well documented issue that doesnt involve Lottie.
If its crashing, Im happy to try to fix it. I believe the most recent update to 2.1.3 fixed an issue that would cause this to crash. Theres nothing I can do about webViews calling CALayer and UIKit off of the main thread. Thats internal to Apple. I have verified this by creating a simple CALayer in your Demo and removing Lottie all together. The CALayer's display is called from the Webcore thread.
Hey, any news on this? I'm having the same crashes on 2.1.3.




@apats Do you have a repro? Without a reliable reproduction I cannot do anything but speculate about the crash. I havent seen it myself yet. If you know some reproducible steps Id love to help!
It's happening on my app too

@tallesborges Do you have a reliable reproduction case?
@buba447 unfortunately, on my side everything works fine and smooth, I saw those crashes when the app went live.
Is there anything else I can help you? Add logs or check specific cases?
@buba447 I also have this crash in my app running 2.1.3 with no reliable reproduction steps. I have not seen it, but I've gotten crash reports
@buba447 just got this crash when app was about to push the screen with Lottie animations on it.
That has been caught while Thread Sanitizer and Undefined Bechavior Sanitizer were enabled in Xcode 9.
No special steps were made, 2 mins ago app worked as expected. As well as on the next launch.

==================
WARNING: ThreadSanitizer: data race (pid=96182)
Read of size 8 at 0x000108ea8ed0 by thread T15 (mutexes: write M784752239780425504):
* #0 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:134 (Lottie:x86_64+0x30b73)
#1 -[LOTLayerContainer displayWithFrame:forceUpdate:] LOTLayerContainer.m:238 (Lottie:x86_64+0x27b33)
#2 -[LOTCompositionContainer displayWithFrame:forceUpdate:] LOTCompositionContainer.m:89 (Lottie:x86_64+0x1b02c)
#3 -[LOTLayerContainer displayWithFrame:] LOTLayerContainer.m:218 (Lottie:x86_64+0x276d5)
#4 -[LOTLayerContainer display] LOTLayerContainer.m:214 (Lottie:x86_64+0x27667)
#5 CA::Context::commit_transaction(CA::Transaction*) <null>:8328448 (QuartzCore:x86_64+0x8c2ee)
Previous write of size 8 at 0x000108ea8ed0 by main thread:
* #0 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:134 (Lottie:x86_64+0x30b8b)
#1 -[LOTLayerContainer displayWithFrame:forceUpdate:] LOTLayerContainer.m:238 (Lottie:x86_64+0x27b33)
#2 -[LOTCompositionContainer displayWithFrame:forceUpdate:] LOTCompositionContainer.m:89 (Lottie:x86_64+0x1b02c)
#3 -[LOTLayerContainer displayWithFrame:] LOTLayerContainer.m:218 (Lottie:x86_64+0x276d5)
#4 -[LOTLayerContainer display] LOTLayerContainer.m:214 (Lottie:x86_64+0x27667)
#5 CA::Context::commit_transaction(CA::Transaction*) <null>:8328448 (QuartzCore:x86_64+0x8c2ee)
#6 start <null>:8328448 (libdyld.dylib:x86_64+0xd80)
Issue is caused by frames marked with "*".
Location is global 'indentation_level' at 0x000108ea8ed0 (Lottie+0x000000075ed0)
Mutex M784752239780425504 is already destroyed.
Thread T15 (tid=13365665, running) created by main thread at:
#0 pthread_create <null>:8328528 (libclang_rt.tsan_iossim_dynamic.dylib:x86_64+0x28f4d)
#1 StartWebThread() <null>:8328528 (WebCore:x86_64+0x125b827)
#2 +[WebView(WebPrivate) enableWebThread] <null>:8328528 (WebKitLegacy:x86_64+0xe6b69)
#3 CALLING_SOME_+initialize_METHOD <null>:8328528 (libobjc.A.dylib:x86_64+0x5a13)
#4 -[MPCoreInstanceProvider buildConfiguredURLRequestWithURL:] MPCoreInstanceProvider.m:144 (Win It Stage:x86_64+0x1007a0ecb)
#5 +[MPSessionTracker trackEvent] MPSessionTracker.m:34 (Win It Stage:x86_64+0x1005d8657)
#6 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ <null>:8328528 (CoreFoundation:x86_64+0x9407b)
#7 start <null>:8328528 (libdyld.dylib:x86_64+0xd80)
SUMMARY: ThreadSanitizer: data race LOTRenderGroup.m:134 in -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:]
==================
ThreadSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report.
==================
WARNING: ThreadSanitizer: data race (pid=96182)
Read of size 8 at 0x7b1c00072ef0 by thread T15 (mutexes: write M784752239780425504):
* #0 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTAnimatorNode.m:41 (Lottie:x86_64+0x111b2)
#1 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:135 (Lottie:x86_64+0x30bf3)
#2 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:135 (Lottie:x86_64+0x30bf3)
#3 -[LOTLayerContainer displayWithFrame:forceUpdate:] LOTLayerContainer.m:238 (Lottie:x86_64+0x27b33)
#4 -[LOTCompositionContainer displayWithFrame:forceUpdate:] LOTCompositionContainer.m:89 (Lottie:x86_64+0x1b02c)
#5 -[LOTLayerContainer displayWithFrame:] LOTLayerContainer.m:218 (Lottie:x86_64+0x276d5)
#6 -[LOTLayerContainer display] LOTLayerContainer.m:214 (Lottie:x86_64+0x27667)
#7 CA::Context::commit_transaction(CA::Transaction*) <null>:8328256 (QuartzCore:x86_64+0x8c2ee)
Previous write of size 8 at 0x7b1c00072ef0 by main thread:
* #0 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTAnimatorNode.m:53 (Lottie:x86_64+0x112c5)
#1 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:135 (Lottie:x86_64+0x30bf3)
#2 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:135 (Lottie:x86_64+0x30bf3)
#3 -[LOTLayerContainer displayWithFrame:forceUpdate:] LOTLayerContainer.m:238 (Lottie:x86_64+0x27b33)
#4 -[LOTCompositionContainer displayWithFrame:forceUpdate:] LOTCompositionContainer.m:89 (Lottie:x86_64+0x1b02c)
#5 -[LOTLayerContainer displayWithFrame:] LOTLayerContainer.m:218 (Lottie:x86_64+0x276d5)
#6 -[LOTLayerContainer display] LOTLayerContainer.m:214 (Lottie:x86_64+0x27667)
#7 CA::Context::commit_transaction(CA::Transaction*) <null>:8328256 (QuartzCore:x86_64+0x8c2ee)
#8 start <null>:8328256 (libdyld.dylib:x86_64+0xd80)
Issue is caused by frames marked with "*".
Location is heap block of size 104 at 0x7b1c00072ed0 allocated by main thread:
#0 calloc <null>:8328272 (libclang_rt.tsan_iossim_dynamic.dylib:x86_64+0x46be2)
#1 class_createInstance <null>:8328272 (libobjc.A.dylib:x86_64+0xf011)
#2 -[LOTRenderGroup initWithInputNode:contents:keyname:] LOTRenderGroup.m:44 (Lottie:x86_64+0x2f685)
#3 -[LOTRenderGroup buildContents:] LOTRenderGroup.m:88 (Lottie:x86_64+0x2fbe5)
#4 -[LOTRenderGroup initWithInputNode:contents:keyname:] LOTRenderGroup.m:44 (Lottie:x86_64+0x2f685)
#5 -[LOTLayerContainer buildContents:] LOTLayerContainer.m:120 (Lottie:x86_64+0x26aa5)
#6 -[LOTLayerContainer commonInitializeWith:inLayerGroup:] LOTLayerContainer.m:94 (Lottie:x86_64+0x261ec)
#7 -[LOTLayerContainer initWithModel:inLayerGroup:] LOTLayerContainer.m:53 (Lottie:x86_64+0x2588f)
#8 -[LOTCompositionContainer intializeWithChildGroup:withAssetGroup:] LOTCompositionContainer.m:64 (Lottie:x86_64+0x1ab0f)
#9 -[LOTCompositionContainer initWithModel:inLayerGroup:withLayerGroup:withAssestGroup:] LOTCompositionContainer.m:39 (Lottie:x86_64+0x1a60c)
#10 -[LOTAnimationView _setupWithSceneModel:] LOTAnimationView.m:148 (Lottie:x86_64+0xbee6)
#11 -[LOTAnimationView initWithModel:inBundle:] LOTAnimationView.m:97 (Lottie:x86_64+0xb902)
#12 +[LOTAnimationView animationNamed:inBundle:] LOTAnimationView.m:37 (Lottie:x86_64+0xabea)
#13 +[LOTAnimationView animationNamed:] LOTAnimationView.m:32 (Lottie:x86_64+0xaac4)
#14 -[SYWTrendingTabBarItem animateBonusGame] SYWTrendingTabBarItem.m:175 (Win It Stage:x86_64+0x1005f000f)
#15 __48-[SYWTrendingTabBarItem animateToBonusGameState]_block_invoke_2 SYWTrendingTabBarItem.m:169 (Win It Stage:x86_64+0x1005efd8c)
#16 -[LOTAnimationView _callCompletionIfNecessary:] LOTAnimationView.m:202 (Lottie:x86_64+0xcaef)
#17 -[LOTAnimationView animationDidStop:finished:] LOTAnimationView.m:604 (Lottie:x86_64+0x10b64)
#18 CA::Layer::run_animation_callbacks(void*) <null>:8328272 (QuartzCore:x86_64+0x10eaf6)
#19 _dispatch_client_callout <null>:8328272 (libdispatch.dylib:x86_64+0x343b)
#20 start <null>:8328272 (libdyld.dylib:x86_64+0xd80)
Mutex M784752239780425504 is already destroyed.
Thread T15 (tid=13365665, running) created by main thread at:
#0 pthread_create <null>:8328336 (libclang_rt.tsan_iossim_dynamic.dylib:x86_64+0x28f4d)
#1 StartWebThread() <null>:8328336 (WebCore:x86_64+0x125b827)
#2 +[WebView(WebPrivate) enableWebThread] <null>:8328336 (WebKitLegacy:x86_64+0xe6b69)
#3 CALLING_SOME_+initialize_METHOD <null>:8328336 (libobjc.A.dylib:x86_64+0x5a13)
#4 -[MPCoreInstanceProvider buildConfiguredURLRequestWithURL:] MPCoreInstanceProvider.m:144 (Win It Stage:x86_64+0x1007a0ecb)
#5 +[MPSessionTracker trackEvent] MPSessionTracker.m:34 (Win It Stage:x86_64+0x1005d8657)
#6 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ <null>:8328336 (CoreFoundation:x86_64+0x9407b)
#7 start <null>:8328336 (libdyld.dylib:x86_64+0xd80)
SUMMARY: ThreadSanitizer: data race LOTAnimatorNode.m:41 in -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:]
==================
ThreadSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report.
==================
WARNING: ThreadSanitizer: data race (pid=96182)
Read of size 8 at 0x7b1c00072fd0 by thread T15 (mutexes: write M784752239780425504):
* #0 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTAnimatorNode.m:41 (Lottie:x86_64+0x111b2)
#1 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTAnimatorNode.m:50 (Lottie:x86_64+0x1129f)
#2 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:135 (Lottie:x86_64+0x30bf3)
#3 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:135 (Lottie:x86_64+0x30bf3)
#4 -[LOTLayerContainer displayWithFrame:forceUpdate:] LOTLayerContainer.m:238 (Lottie:x86_64+0x27b33)
#5 -[LOTCompositionContainer displayWithFrame:forceUpdate:] LOTCompositionContainer.m:89 (Lottie:x86_64+0x1b02c)
#6 -[LOTLayerContainer displayWithFrame:] LOTLayerContainer.m:218 (Lottie:x86_64+0x276d5)
#7 -[LOTLayerContainer display] LOTLayerContainer.m:214 (Lottie:x86_64+0x27667)
#8 CA::Context::commit_transaction(CA::Transaction*) <null>:8328160 (QuartzCore:x86_64+0x8c2ee)
Previous write of size 8 at 0x7b1c00072fd0 by main thread:
* #0 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTAnimatorNode.m:53 (Lottie:x86_64+0x112c5)
#1 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTAnimatorNode.m:50 (Lottie:x86_64+0x1129f)
#2 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:135 (Lottie:x86_64+0x30bf3)
#3 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:135 (Lottie:x86_64+0x30bf3)
#4 -[LOTLayerContainer displayWithFrame:forceUpdate:] LOTLayerContainer.m:238 (Lottie:x86_64+0x27b33)
#5 -[LOTCompositionContainer displayWithFrame:forceUpdate:] LOTCompositionContainer.m:89 (Lottie:x86_64+0x1b02c)
#6 -[LOTLayerContainer displayWithFrame:] LOTLayerContainer.m:218 (Lottie:x86_64+0x276d5)
#7 -[LOTLayerContainer display] LOTLayerContainer.m:214 (Lottie:x86_64+0x27667)
#8 CA::Context::commit_transaction(CA::Transaction*) <null>:8328160 (QuartzCore:x86_64+0x8c2ee)
#9 start <null>:8328160 (libdyld.dylib:x86_64+0xd80)
Issue is caused by frames marked with "*".
Location is heap block of size 112 at 0x7b1c00072fb0 allocated by main thread:
#0 calloc <null>:8328176 (libclang_rt.tsan_iossim_dynamic.dylib:x86_64+0x46be2)
#1 class_createInstance <null>:8328176 (libobjc.A.dylib:x86_64+0xf011)
#2 -[LOTRenderGroup initWithInputNode:contents:keyname:] LOTRenderGroup.m:44 (Lottie:x86_64+0x2f685)
#3 -[LOTRenderGroup buildContents:] LOTRenderGroup.m:88 (Lottie:x86_64+0x2fbe5)
#4 -[LOTRenderGroup initWithInputNode:contents:keyname:] LOTRenderGroup.m:44 (Lottie:x86_64+0x2f685)
#5 -[LOTLayerContainer buildContents:] LOTLayerContainer.m:120 (Lottie:x86_64+0x26aa5)
#6 -[LOTLayerContainer commonInitializeWith:inLayerGroup:] LOTLayerContainer.m:94 (Lottie:x86_64+0x261ec)
#7 -[LOTLayerContainer initWithModel:inLayerGroup:] LOTLayerContainer.m:53 (Lottie:x86_64+0x2588f)
#8 -[LOTCompositionContainer intializeWithChildGroup:withAssetGroup:] LOTCompositionContainer.m:64 (Lottie:x86_64+0x1ab0f)
#9 -[LOTCompositionContainer initWithModel:inLayerGroup:withLayerGroup:withAssestGroup:] LOTCompositionContainer.m:39 (Lottie:x86_64+0x1a60c)
#10 -[LOTAnimationView _setupWithSceneModel:] LOTAnimationView.m:148 (Lottie:x86_64+0xbee6)
#11 -[LOTAnimationView initWithModel:inBundle:] LOTAnimationView.m:97 (Lottie:x86_64+0xb902)
#12 +[LOTAnimationView animationNamed:inBundle:] LOTAnimationView.m:37 (Lottie:x86_64+0xabea)
#13 +[LOTAnimationView animationNamed:] LOTAnimationView.m:32 (Lottie:x86_64+0xaac4)
#14 -[SYWTrendingTabBarItem animateBonusGame] SYWTrendingTabBarItem.m:175 (Win It Stage:x86_64+0x1005f000f)
#15 __48-[SYWTrendingTabBarItem animateToBonusGameState]_block_invoke_2 SYWTrendingTabBarItem.m:169 (Win It Stage:x86_64+0x1005efd8c)
#16 -[LOTAnimationView _callCompletionIfNecessary:] LOTAnimationView.m:202 (Lottie:x86_64+0xcaef)
#17 -[LOTAnimationView animationDidStop:finished:] LOTAnimationView.m:604 (Lottie:x86_64+0x10b64)
#18 CA::Layer::run_animation_callbacks(void*) <null>:8328176 (QuartzCore:x86_64+0x10eaf6)
#19 _dispatch_client_callout <null>:8328176 (libdispatch.dylib:x86_64+0x343b)
#20 start <null>:8328176 (libdyld.dylib:x86_64+0xd80)
Mutex M784752239780425504 is already destroyed.
Thread T15 (tid=13365665, running) created by main thread at:
#0 pthread_create <null>:8328240 (libclang_rt.tsan_iossim_dynamic.dylib:x86_64+0x28f4d)
#1 StartWebThread() <null>:8328240 (WebCore:x86_64+0x125b827)
#2 +[WebView(WebPrivate) enableWebThread] <null>:8328240 (WebKitLegacy:x86_64+0xe6b69)
#3 CALLING_SOME_+initialize_METHOD <null>:8328240 (libobjc.A.dylib:x86_64+0x5a13)
#4 -[MPCoreInstanceProvider buildConfiguredURLRequestWithURL:] MPCoreInstanceProvider.m:144 (Win It Stage:x86_64+0x1007a0ecb)
#5 +[MPSessionTracker trackEvent] MPSessionTracker.m:34 (Win It Stage:x86_64+0x1005d8657)
#6 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ <null>:8328240 (CoreFoundation:x86_64+0x9407b)
#7 start <null>:8328240 (libdyld.dylib:x86_64+0xd80)
SUMMARY: ThreadSanitizer: data race LOTAnimatorNode.m:41 in -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:]
==================
ThreadSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report.
==================
WARNING: ThreadSanitizer: data race (pid=96182)
Read of size 8 at 0x7b1800012fe0 by thread T15 (mutexes: write M784752239780425504):
* #0 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTAnimatorNode.m:41 (Lottie:x86_64+0x111b2)
#1 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTAnimatorNode.m:50 (Lottie:x86_64+0x1129f)
#2 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTAnimatorNode.m:50 (Lottie:x86_64+0x1129f)
#3 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:135 (Lottie:x86_64+0x30bf3)
#4 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:135 (Lottie:x86_64+0x30bf3)
#5 -[LOTLayerContainer displayWithFrame:forceUpdate:] LOTLayerContainer.m:238 (Lottie:x86_64+0x27b33)
#6 -[LOTCompositionContainer displayWithFrame:forceUpdate:] LOTCompositionContainer.m:89 (Lottie:x86_64+0x1b02c)
#7 -[LOTLayerContainer displayWithFrame:] LOTLayerContainer.m:218 (Lottie:x86_64+0x276d5)
#8 -[LOTLayerContainer display] LOTLayerContainer.m:214 (Lottie:x86_64+0x27667)
#9 CA::Context::commit_transaction(CA::Transaction*) <null>:8328064 (QuartzCore:x86_64+0x8c2ee)
Previous write of size 8 at 0x7b1800012fe0 by main thread:
* #0 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTAnimatorNode.m:53 (Lottie:x86_64+0x112c5)
#1 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTAnimatorNode.m:50 (Lottie:x86_64+0x1129f)
#2 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTAnimatorNode.m:50 (Lottie:x86_64+0x1129f)
#3 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:135 (Lottie:x86_64+0x30bf3)
#4 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] LOTRenderGroup.m:135 (Lottie:x86_64+0x30bf3)
#5 -[LOTLayerContainer displayWithFrame:forceUpdate:] LOTLayerContainer.m:238 (Lottie:x86_64+0x27b33)
#6 -[LOTCompositionContainer displayWithFrame:forceUpdate:] LOTCompositionContainer.m:89 (Lottie:x86_64+0x1b02c)
#7 -[LOTLayerContainer displayWithFrame:] LOTLayerContainer.m:218 (Lottie:x86_64+0x276d5)
#8 -[LOTLayerContainer display] LOTLayerContainer.m:214 (Lottie:x86_64+0x27667)
#9 CA::Context::commit_transaction(CA::Transaction*) <null>:8328064 (QuartzCore:x86_64+0x8c2ee)
#10 start <null>:8328064 (libdyld.dylib:x86_64+0xd80)
Issue is caused by frames marked with "*".
Location is heap block of size 88 at 0x7b1800012fc0 allocated by main thread:
#0 calloc <null>:8328080 (libclang_rt.tsan_iossim_dynamic.dylib:x86_64+0x46be2)
#1 class_createInstance <null>:8328080 (libobjc.A.dylib:x86_64+0xf011)
#2 -[LOTRenderGroup initWithInputNode:contents:keyname:] LOTRenderGroup.m:44 (Lottie:x86_64+0x2f685)
#3 -[LOTRenderGroup buildContents:] LOTRenderGroup.m:88 (Lottie:x86_64+0x2fbe5)
#4 -[LOTRenderGroup initWithInputNode:contents:keyname:] LOTRenderGroup.m:44 (Lottie:x86_64+0x2f685)
#5 -[LOTLayerContainer buildContents:] LOTLayerContainer.m:120 (Lottie:x86_64+0x26aa5)
#6 -[LOTLayerContainer commonInitializeWith:inLayerGroup:] LOTLayerContainer.m:94 (Lottie:x86_64+0x261ec)
#7 -[LOTLayerContainer initWithModel:inLayerGroup:] LOTLayerContainer.m:53 (Lottie:x86_64+0x2588f)
#8 -[LOTCompositionContainer intializeWithChildGroup:withAssetGroup:] LOTCompositionContainer.m:64 (Lottie:x86_64+0x1ab0f)
#9 -[LOTCompositionContainer initWithModel:inLayerGroup:withLayerGroup:withAssestGroup:] LOTCompositionContainer.m:39 (Lottie:x86_64+0x1a60c)
#10 -[LOTAnimationView _setupWithSceneModel:] LOTAnimationView.m:148 (Lottie:x86_64+0xbee6)
#11 -[LOTAnimationView initWithModel:inBundle:] LOTAnimationView.m:97 (Lottie:x86_64+0xb902)
#12 +[LOTAnimationView animationNamed:inBundle:] LOTAnimationView.m:37 (Lottie:x86_64+0xabea)
#13 +[LOTAnimationView animationNamed:] LOTAnimationView.m:32 (Lottie:x86_64+0xaac4)
#14 -[SYWTrendingTabBarItem animateBonusGame] SYWTrendingTabBarItem.m:175 (Win It Stage:x86_64+0x1005f000f)
#15 __48-[SYWTrendingTabBarItem animateToBonusGameState]_block_invoke_2 SYWTrendingTabBarItem.m:169 (Win It Stage:x86_64+0x1005efd8c)
#16 -[LOTAnimationView _callCompletionIfNecessary:] LOTAnimationView.m:202 (Lottie:x86_64+0xcaef)
#17 -[LOTAnimationView animationDidStop:finished:] LOTAnimationView.m:604 (Lottie:x86_64+0x10b64)
#18 CA::Layer::run_animation_callbacks(void*) <null>:8328080 (QuartzCore:x86_64+0x10eaf6)
#19 _dispatch_client_callout <null>:8328080 (libdispatch.dylib:x86_64+0x343b)
#20 start <null>:8328080 (libdyld.dylib:x86_64+0xd80)
Mutex M784752239780425504 is already destroyed.
Thread T15 (tid=13365665, running) created by main thread at:
#0 pthread_create <null>:8328144 (libclang_rt.tsan_iossim_dynamic.dylib:x86_64+0x28f4d)
#1 StartWebThread() <null>:8328144 (WebCore:x86_64+0x125b827)
#2 +[WebView(WebPrivate) enableWebThread] <null>:8328144 (WebKitLegacy:x86_64+0xe6b69)
#3 CALLING_SOME_+initialize_METHOD <null>:8328144 (libobjc.A.dylib:x86_64+0x5a13)
#4 -[MPCoreInstanceProvider buildConfiguredURLRequestWithURL:] MPCoreInstanceProvider.m:144 (Win It Stage:x86_64+0x1007a0ecb)
#5 +[MPSessionTracker trackEvent] MPSessionTracker.m:34 (Win It Stage:x86_64+0x1005d8657)
#6 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ <null>:8328144 (CoreFoundation:x86_64+0x9407b)
#7 start <null>:8328144 (libdyld.dylib:x86_64+0xd80)
SUMMARY: ThreadSanitizer: data race LOTAnimatorNode.m:41 in -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:]
==================
Any luck with this? We are getting the same crash. We have also beed unable to reproduce the issue locally, but have a lot of users crashing.
I had something similar to what we are getting when I haven't stopped the animation when a user was navigating away from the controller that is playing the animation.
I haven't released the app yet, so no updates from Fabric on the crash logs. I'll keep you posted as soon as the update will be live.
Here is a sample repo that can recreate the crash. See Gordon's fork above for a potential fix.
Hi,
Any luck!! Is someone got the resolution of the crash? I am also experiencing the same issue and that too is intermittent. I am unable to found the exact steps to replicate the crash. It would be good if someone can provide the lead to fix this issue.
Best Regards,
Rakesh Jaiswal
Most helpful comment
Any luck with this? We are getting the same crash. We have also beed unable to reproduce the issue locally, but have a lot of users crashing.