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

多线程锁等待,导致主线程等待并卡死的紧急Bug报告 #166

Open
LuCaiOS opened this issue Jul 21, 2022 · 1 comment
Open

Comments

@LuCaiOS
Copy link

LuCaiOS commented Jul 21, 2022

我们在APM监测到这个库导致了很多卡死,看日志是因为递归锁导致的多线程访问锁等待导致的卡死问题。
libsystem_kernel.dylib
___psynch_mutexwait (in libsystem_kernel.dylib)

libsystem_pthread.dylib
__pthread_mutex_firstfit_lock_wait (in libsystem_pthread.dylib)

libsystem_pthread.dylib
__pthread_mutex_firstfit_lock_slow (in libsystem_pthread.dylib)

Foundation
-[NSRecursiveLock lock] (in Foundation)

pregnancy
-[KTVHCDataUnitPool lock] (in pregnancy:KTVHCDataUnitPool.m:285)

pregnancy
-[KTVHCDataUnitPool archiveIfNeeded] (in pregnancy:KTVHCDataUnitPool.m:246)

CoreFoundation
_CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER (in CoreFoundation)

CoreFoundation
____CFXRegistrationPost_block_invoke (in CoreFoundation)

CoreFoundation
__CFXRegistrationPost (in CoreFoundation)

CoreFoundation
__CFXNotificationPost (in CoreFoundation)

Foundation
-[NSNotificationCenter postNotificationName:object:userInfo:] (in Foundation)

UIKitCore
-[UIApplication _deactivateForReason:notify:] (in UIKitCore)

UIKitCore
-[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] (in UIKitCore)

UIKitCore
-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] (in UIKitCore)

UIKitCore
-[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] (in UIKitCore)

UIKitCore
___186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke (in UIKitCore)

UIKitCore
+[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] (in UIKitCore)

UIKitCore
__UISceneSettingsDiffActionPerformChangesWithTransitionContext (in UIKitCore)

UIKitCore
-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] (in UIKitCore)

UIKitCore
__64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.615 (in UIKitCore)

UIKitCore
-[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] (in UIKitCore)

UIKitCore
-[UIScene scene:didUpdateWithDiff:transitionContext:completion:] (in UIKitCore)

UIKitCore
-[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] (in UIKitCore)
`

@LuCaiOS
Copy link
Author

LuCaiOS commented Jul 21, 2022

类似的问题还有一个上报
`1
libsystem_kernel.dylib
___psynch_mutexwait (in libsystem_kernel.dylib)

2
libsystem_pthread.dylib
__pthread_mutex_firstfit_lock_wait (in libsystem_pthread.dylib)

3
libsystem_pthread.dylib
__pthread_mutex_firstfit_lock_slow (in libsystem_pthread.dylib)

4
Foundation
-[NSRecursiveLock lock] (in Foundation)

5
pregnancy
-[KTVHCDataUnit lock] (in pregnancy:KTVHCDataUnit.m:338)

6
pregnancy
-[KTVHCDataUnit encodeWithCoder:] (in pregnancy:KTVHCDataUnit.m:60)

7
Foundation
__encodeObject (in Foundation)

8
Foundation
-[NSKeyedArchiver _encodeArrayOfObjects:forKey:] (in Foundation)

9
Foundation
-[NSArray(NSArray) encodeWithCoder:] (in Foundation)

10
Foundation
__encodeObject (in Foundation)

11
Foundation
+[NSKeyedArchiver archiveRootObject:toFile:] (in Foundation)

12
pregnancy
-[KTVHCDataUnitQueue archive] (in pregnancy:KTVHCDataUnitQueue.m:89)

13
pregnancy
-[KTVHCDataUnitPool archiveIfNeeded] (in pregnancy:KTVHCDataUnitPool.m:249)

14
CoreFoundation
_CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER (in CoreFoundation)

15
CoreFoundation
____CFXRegistrationPost_block_invoke (in CoreFoundation)

16
CoreFoundation
__CFXRegistrationPost (in CoreFoundation)

17
CoreFoundation
__CFXNotificationPost (in CoreFoundation)

18
Foundation
-[NSNotificationCenter postNotificationName:object:userInfo:] (in Foundation)

19
UIKitCore
___47-[UIApplication _applicationDidEnterBackground]_block_invoke (in UIKitCore)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant