MoathOthman / MOLH

Localization helper for iOS apps mainly focusing on the LTR/RTL issue
MIT License
117 stars 36 forks source link

Regressed crash in MOLH file #75

Open mohamedmostafafawzi opened 2 years ago

mohamedmostafafawzi commented 2 years ago

I have this regressed crash that rarely happens in

MOLH.swift - Line 327
UIControl.cstmlayoutSubviews() + 327

and I don't really know what is the reason since there's no memory leaks in that class at all, here is the stack trace:

_Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALIDADDRESS 0x0000000000000004

0  QuartzCore                     0x2179c CA::Layer::superlayer(CA::Transaction*) + 24
1  UIKitCore                      0x19305c _UIViewSetLayer + 108
2  UIKitCore                      0x1a5344 UIViewCommonInitWithFrame + 1216
3  UIKitCore                      0x194374 -[UIView initWithFrame:] + 128
4  UIKitCore                      0x201804 -[UIScrollView initWithFrame:] + 52
5  UIKitCore                      0x53bf84 -[UIFieldEditor initWithTextField:] + 84
6  UIKitCore                      0x2980d0 -[UITextField _fieldEditor] + 72
7  UIKitCore                      0x276ca0 -[UITextField selectedTextRange] + 24
8  UIKitCore                      0x442844 -[UIResponder(UITextInputAdditions) _caretRect] + 40
9  UIKitCore                      0x42b7c0 -[UITextField _textSizeUsingFullFontSize:] + 48
10 UIKitCore                      0x24e98c -[UITextField _intrinsicSizeWithinSize:] + 200
11 UIKitCore                      0x1f3d2c -[UIView(UIConstraintBasedLayout) intrinsicContentSize] + 148
12 UIKitCore                      0x19cae8 -[UIView _generateContentSizeConstraints] + 56
13 UIKitCore                      0x24beac -[UIView _updateContentSizeConstraints] + 268
14 UIKitCore                      0x2f6440 -[UIView(AdditionalLayoutSupport) _updateSystemConstraints] + 124
15 UIKitCore                      0x35aaac -[UIView(AdditionalLayoutSupport) _sendUpdateConstraintsIfNecessaryForSecondPass:] + 480
16 UIKitCore                      0x17f5a0 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 996
17 UIKitCore                      0x1e494c __100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke + 84
18 UIKitCore                      0x25c954 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 160
19 UIKitCore                      0x45dcf0 -[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeededWithViewForVariableChangeNotifications:] + 516
20 UIKitCore                      0x18355c -[UIView _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 360
21 UIKitCore                      0x309a04 -[UITextField layoutSubviews] + 56
22 MOLH                           0xc3c0 UIControl.cstmlayoutSubviews() + 327 (MOLH.swift:327)
23 MOLH                           0xc404 @objc UIControl.cstmlayoutSubviews() + 4377609220 (<compiler-generated>:4377609220)
24 UIKitCore                      0x50461c -[UINib instantiateWithOwner:options:] + 2280
25 UIKitCore                      0x282544 -[UITableView _dequeueReusableViewOfType:withIdentifier:] + 660
26 UIKitCore                      0x1cb2ec -[UITableView dequeueReusableCellWithIdentifier:] + 208
27 UIKitCore                      0x54b0e4 -[UITableView _dequeueReusableCellWithIdentifier:forIndexPath:usingPresentationValues:] + 276
28 UIKitCore                      0x1ea698 -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:] + 96
29 Drops                          0x3bb3c4 ProductDetailsViewController.tableView(_:cellForRowAt:) + 319 (ProductDetailsViewController.swift:319)
30 Drops                          0x3bcab4 @objc ProductDetailsViewController.tableView(_:cellForRowAt:) + 4348938932 (<compiler-generated>:4348938932)
31 UIKitCore                      0x26ffe8 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1624
32 UIKitCore                      0x45a858 -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] + 700
33 UIKitCore                      0x293f04 -[UITableView _updateVisibleCellsNow:] + 1464
34 UIKitCore                      0x16c484 -[UITableView layoutSubviews] + 436
35 UIKitCore                      0x17c1d0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2556
36 QuartzCore                     0x3d520 CA::Layer::layout_if_needed(CA::Transaction*) + 528
37 UIKitCore                      0x1dd8b0 -[UIView(Hierarchy) layoutBelowIfNeeded] + 556
38 UIKitCore                      0x355b8c -[UISheetPresentationController _sheetLayoutInfoLayout:] + 48
39 UIKitCore                      0x2f38a4 -[_UISheetLayoutInfo _layout] + 332
40 UIKitCore                      0x2b1f3c __54-[UISheetPresentationController _transitionWillBegin:]_block_invoke_2 + 52
41 UIKitCore                      0x1632d0 +[UIView(Animation) performWithoutAnimation:] + 96
42 UIKitCore                      0x103242c __54-[UISheetPresentationController _transitionWillBegin:]_block_invoke.523 + 140
43 UIKitCore                      0x258288 -[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] + 268
44 UIKitCore                      0x4f5220 -[_UIViewControllerTransitionContext __runAlongsideAnimations] + 264
45 UIKitCore                      0x25e458 __63+[UIView(Animation) _setAlongsideAnimations:toRunByEndOfBlock:]_block_invoke + 28
46 UIKitCore                      0x54c13c -[UIViewAnimationState _runAlongsideAnimations] + 32
47 UIKitCore                      0x58d28c -[UIViewAnimationState pop] + 52
48 UIKitCore                      0x25bdb8 +[UIViewAnimationState popAnimationState] + 64
49 UIKitCore                      0x1751a8 +[UIView _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 728
50 UIKitCore                      0x11a742c __50-[UITransitionView _startTransition:withDuration:]_block_invoke.170 + 156
51 UIKitCore                      0x260620 +[UIView(UIViewAnimationWithBlocks) conditionallyAnimate:withAnimation:layout:completion:] + 88
52 UIKitCore                      0x324590 -[UITransitionView _startTransition:withDuration:] + 692
53 UIKitCore                      0x25f770 -[UITransitionView transition:fromView:toView:removeFromView:] + 2552
54 UIKitCore                      0x2bf43c -[UIViewControllerBuiltinTransitionViewAnimator animateTransition:] + 1496
55 UIKitCore                      0x489fdc ___UIViewControllerTransitioningRunCustomTransition_block_invoke_2 + 72
56 UIKitCore                      0x2c850c +[UIKeyboardSceneDelegate _pinInputViewsForKeyboardSceneDelegate:onBehalfOfResponder:duringBlock:] + 104
57 UIKitCore                      0x33b0d0 ___UIViewControllerTransitioningRunCustomTransition_block_invoke.641 + 176
58 UIKitCore                      0x3c1b90 +[UIView(Animation) _setAlongsideAnimations:toRunByEndOfBlock:] + 172
59 UIKitCore                      0x265284 _UIViewControllerTransitioningRunCustomTransition + 572
60 UIKitCore                      0x8903d8 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke.401 + 2152
61 UIKitCore                      0x30c240 -[_UIAfterCACommitBlock run] + 64
62 UIKitCore                      0x227770 -[_UIAfterCACommitQueue flush] + 200
63 libdispatch.dylib              0x63094 _dispatch_call_block_and_release + 24
64 libdispatch.dylib              0x64094 _dispatch_client_callout + 16
65 libdispatch.dylib              0x45858 _dispatch_main_queue_drain + 888
66 libdispatch.dylib              0x454d0 _dispatch_main_queue_callback_4CF$VARIANT$armv81 + 36
67 CoreFoundation                 0x4e0d4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
68 CoreFoundation                 0xb5f8 __CFRunLoopRun + 2544
69 CoreFoundation                 0x1e250 CFRunLoopRunSpecific + 572
70 GraphicsServices               0x1988 GSEventRunModal + 160
71 UIKitCore                      0x4e5a94 -[UIApplication _run] + 1080
72 UIKitCore                      0x27efd4 UIApplicationMain + 336
73 libswiftUIKit.dylib            0x27ee4 UIApplicationMain(_:_:_:_:) + 100
74 Drops                          0x1203b4 static UIApplicationDelegate.main() + 4346201012 (<compiler-generated>:4346201012)
75 Drops                          0x12033c static AppDelegate.$main() + 25 (<compiler-generated>:25)
76 Drops                          0x121da0 main + 26 (AppDelegate.swift:26)
77 ???                            0x105f304d0 (Missing)
MoathOthman commented 1 year ago

@mohamedmostafafawzi hey , have you managed to figure this out.

abdallahnh commented 1 year ago

No

On Thu, Nov 10, 2022, 2:52 PM Moath othman @.***> wrote:

@mohamedmostafafawzi https://github.com/mohamedmostafafawzi hey , have you managed to figure this out.

— Reply to this email directly, view it on GitHub https://github.com/MoathOthman/MOLH/issues/75#issuecomment-1310235231, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADLUO4OBGMQVA4TVM5ZW3F3WHTVXZANCNFSM6AAAAAARCCBBJM . You are receiving this because you are subscribed to this thread.Message ID: @.***>