基础设施-[NSConcreteMapTable assign:key:value:isNew:]崩溃:com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS

4

我遇到了一个只在IOS 7上发生的崩溃问题,虽然我无法复现它,但它经常发生。有人有答案或者至少知道问题可能出在哪里吗? 我已经解决了所有与ios7相关的警告,但崩溃仍然发生。 日志已附上。

Thread : Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x3b43c626 objc_msgSend + 5
1  Foundation                     0x315a9681 -[NSConcreteMapTable assign:key:value:isNew:] + 68
2  Foundation                     0x315a95fb -[NSConcreteMapTable setObject:forKey:] + 82
3  Foundation                     0x315ecaf7 -[NSISEngine setRowWithHead:body:] + 30
4  Foundation                     0x315ef5d1 -[NSISEngine pivotToMakeBodyVar:newHeadOfRowWithHead:andDropRow:] + 388
5  Foundation                     0x315ed325 -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 236
6  Foundation                     0x315efd9f -[NSISEngine tryUsingArtificialVariableToAddConstraintWithMarker:rowBody:usingInfeasibilityHandlingBehavior:mutuallyExclusiveConstraints:] + 226
7  Foundation                     0x315eb5fd -[NSISEngine tryToAddConstraintWithMarker:expression:integralizationAdjustment:mutuallyExclusiveConstraints:] + 692
8  Foundation                     0x315eb23b -[NSLayoutConstraint _addLoweredExpression:toEngine:integralizationAdjustment:lastLoweredConstantWasRounded:mutuallyExclusiveConstraints:] + 286
9  Foundation                     0x315e8f6d -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 232
10 Foundation                     0x315f47ed -[NSLayoutConstraint _addToEngine:] + 28
11 UIKit                          0x33591c55 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 332
12 Foundation                     0x315e8b2b -[NSISEngine withBehaviors:performModifications:] + 210
13 UIKit                          0x33591ad9 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 336
14 UIKit                          0x3349e20d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 200
15 UIKit                          0x33591bbb __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 178
16 Foundation                     0x315e8b2b -[NSISEngine withBehaviors:performModifications:] + 210
17 UIKit                          0x33591ad9 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 336
18 UIKit                          0x3349e20d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 200
19 UIKit                          0x33591bbb __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 178
20 Foundation                     0x315e8b2b -[NSISEngine withBehaviors:performModifications:] + 210
21 UIKit                          0x33591ad9 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 336
22 UIKit                          0x3349e20d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 200
23 UIKit                          0x33591bbb __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 178
24 Foundation                     0x315e8b2b -[NSISEngine withBehaviors:performModifications:] + 210
25 UIKit                          0x33591ad9 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 336
26 UIKit                          0x3349e20d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 200
27 UIKit                          0x3349de33 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 82
28 Foundation                     0x315e8b2b -[NSISEngine withBehaviors:performModifications:] + 210
29 UIKit                          0x3349dcd3 -[UIView(Hierarchy) _postMovedFromSuperview:] + 298
30 UIKit                          0x334aaa4f -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1414
31 UIKit                          0x334aa4bf -[UIView(Hierarchy) addSubview:] + 30
32 UIKit                          0x3358bdb7 -[UITransitionView transition:fromView:toView:removeFromView:] + 978
33 UIKit                          0x335cbf3f -[UITransitionView transition:fromView:toView:] + 30
34 UIKit                          0x335cbf15 -[UITransitionView transition:toView:] + 104
35 UIKit                          0x335cb03b -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 1106
36 UIKit                          0x335cabdf -[UITabBarController transitionFromViewController:toViewController:] + 38
37 UIKit                          0x335caab7 -[UITabBarController _setSelectedViewController:] + 258
38 UIKit                          0x33694dd5 -[UITabBarController _tabBarItemClicked:] + 272
39 UIKit                          0x334d4037 -[UIApplication sendAction:to:from:forEvent:] + 90
40 UIKit                          0x334d3fd7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
41 UIKit                          0x33694c8b -[UITabBar _sendAction:withEvent:] + 370
42 UIKit                          0x334d4037 -[UIApplication sendAction:to:from:forEvent:] + 90
43 UIKit                          0x334d3fd7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
44 UIKit                          0x334d3fb1 -[UIControl sendAction:to:forEvent:] + 44
45 UIKit                          0x334bf717 -[UIControl _sendActionsForEvents:withEvent:] + 374
46 UIKit                          0x336949ab -[UITabBar(Static) _buttonUp:] + 118
47 UIKit                          0x334d4037 -[UIApplication sendAction:to:from:forEvent:] + 90
48 UIKit                          0x334d3fd7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
49 UIKit                          0x334d3fb1 -[UIControl sendAction:to:forEvent:] + 44
50 UIKit                          0x334bf717 -[UIControl _sendActionsForEvents:withEvent:] + 374
51 UIKit                          0x334d3a2f -[UIControl touchesEnded:withEvent:] + 590
52 UIKit                          0x334d3701 -[UIWindow _sendTouchesForEvent:] + 528
53 UIKit                          0x334ce6cb -[UIWindow sendEvent:] + 758
54 UIKit                          0x334a38cd -[UIApplication sendEvent:] + 196
55 UIKit                          0x334a1f77 _UIApplicationHandleEventQueue + 7102
56 CoreFoundation                 0x30c4d20b __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
57 CoreFoundation                 0x30c4c6db __CFRunLoopDoSources0 + 206
58 CoreFoundation                 0x30c4aecf __CFRunLoopRun + 622
59 CoreFoundation                 0x30bb5ebf CFRunLoopRunSpecific + 522
60 CoreFoundation                 0x30bb5ca3 CFRunLoopRunInMode + 106
61 GraphicsServices               0x35abb663 GSEventRunModal + 138
62 UIKit                          0x3350214d UIApplicationMain + 1136

有时候我也会遇到这个问题,在 Foundation 或 UIKit 上有时会崩溃。 - vichevstefan
你知道是什么导致了这个崩溃吗? - Nachum
不,我希望这篇文章能够收集答案。 - vichevstefan
我遇到了同样的问题。奇怪的是,这只发生在3.5英寸的设备上(ip4,ip4S),os7.x。在ip5上运行良好。我尝试了很多方法,但仍然无法修复这个错误。 - nahung89
3个回答

0

我遇到了同样的问题。奇怪的是,它只在3.5英寸的设备(ip4,ip4S),os7.x上出现。在ip5上运行良好。

更新:我们的团队找到了根本原因。这是因为我们在代码中使用了这个动画。

[UIView animateWithDuration:0.4f delay:0 usingSpringWithDamping:0.5f initialSpringVelocity:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{
                self.transform = CGAffineTransformMakeScale(sx,sy);
            } completion:^(BOOL finished) {
                self.hidden = !visible;
            }];

为了修复这个 bug,我们避免在 iOS <8.0 上运行动画。
 if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1) {
        [UIView animateWithDuration:0.4f delay:0 usingSpringWithDamping:0.5f initialSpringVelocity:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{
            self.transform = CGAffineTransformMakeScale(sx,sy);
        } completion:^(BOOL finished) {
            if (finished) {
                self.hidden = !visible;
            }
        }];
    } else {
        self.transform = CGAffineTransformMakeScale(sx,sy);
        self.hidden = !visible;
    }

希望这能帮到你!


0
我遇到了类似的崩溃,但是发生在我对一个在网络回调中创建的UIView执行removeFromSuperview时。在[NSISEngine withBehaviors:performModifications:]之后,它开始出错。
例如,在handleReadStreamEvent内部。
if (!CFReadStreamSetClient( inputStream, kCFStreamEventHasBytesAvailable | kCFStreamEventErrorOccurred | kCFStreamEventEndEncountered | kCFStreamEventOpenCompleted
                           , handleReadStreamEvent, &context ) )

当在回调函数内创建视图时,似乎任何视图在从父视图中移除时都会崩溃 - 大多数情况下。

每当我在回调函数内进行任何UIView更改时,最终都使用了这个方法。

- (void)performSelector:(SEL)aSelector withObject:(id)anArgument afterDelay:(NSTimeInterval)delay;

当在循环计时器回调函数内部时,同样的事情发生了。

CFRunLoopAddTimer( CFRunLoopGetMain(), timeoutTimer, kCFRunLoopCommonModes);

0

感谢任何回应的人。

我通过在弹出视图控制器之前删除键盘(resignFirstResponder)来解决了这个问题。

在那个屏幕上,我有两个文本字段,其中一个连接到键盘(inpuAccessoryView),另一个只是激活第一个(我正在开发聊天),当弹出视图控制器时,可能出了些问题。

希望这能帮助到某些人。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接