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

[DTAccessibilityElement accessibilityFrame] Crash with SEGV_ACCERR #1230

Open
Daemonson opened this issue Mar 22, 2021 · 3 comments
Open

[DTAccessibilityElement accessibilityFrame] Crash with SEGV_ACCERR #1230

Daemonson opened this issue Mar 22, 2021 · 3 comments

Comments

@Daemonson
Copy link

Hi there, our app recently encountered some crashes with users whose iPhone enabled the Accessibility functionality. Below are some crash Infos:

Device Top 5
iPhone 11 78.57%
iPhone 12 Pro Max 19.64%
iPhone 12 1.79%

iOS version Top 5
14.3 (18C66) 83.02%
14.2 (18B111) 13.21%
14.2 (18B92) 3.77%


0 libobjc.A.dylib | objc_retain + 16
-- | --
1 AppName | -[DTAccessibilityElement accessibilityFrame] (DTAccessibilityElement.m:34)
2 UIAccessibility | -[NSObject(AXPrivCategory) _iosAccessibilityAttributeValue:] + 5064
3 UIAccessibility | __copyMultipleAttributeValuesCallback + 544
4 AXRuntime | ____AXXMIGCopyMultipleAttributeValues_block_invoke + 64
5 AXRuntime | __handleNonMainThreadCallback + 68
6 AXRuntime | _AXXMIGCopyMultipleAttributeValues + 360
7 AXRuntime | __XCopyMultipleAttributeValues + 396
8 AXRuntime | _mshMIGPerform + 272
9 CoreFoundation | ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 60
10 CoreFoundation | ___CFRunLoopDoSource1 + 596
11 CoreFoundation | ___CFRunLoopRun + 2360
12 CoreFoundation | CFRunLoopRunSpecific + 600
13 GraphicsServices | GSEventRunModal + 164
14 UIKitCore | -[UIApplication _run] + 1072
15 UIKitCore | UIApplicationMain + 168
16 AppName | main (main.m:17)
17 libdyld.dylib | _start + 4

From the crash log, it seems like the parentView has been released somewhere. The parentView object is attributed by unsafe_unretained. When the parentView object has been released, it will be a bad access address. I think that's the point that caused this crash.

So, if it is possible to upgrade the project target version higher than iOS 4.3 and then replace the unsafe_unretained to weak? Thanks a lot.

@odrobnik
Copy link
Collaborator

We already have a macro to use weak if the OS supports it. I made the necessary change. Please test if that resolves the issue.

@Daemonson
Copy link
Author

We already have a macro to use weak if the OS supports it. I made the necessary change. Please test if that resolves the issue.

❤️ Thanks a lot. I have found the macro. I will test it in my next released version. And I will give feedback then.

@Daemonson
Copy link
Author

This DT_WEAK_PROPERTY does not seem to resolve the issue. This crash only happens on iOS 14.x. But I can't reproduce this crash on my devices when I enable the VoiceOver functionality.

#import <DTFoundation/DTWeakSupport.h>

static const CGPoint DTAccessibilityElementNullActivationPoint = {CGFLOAT_MAX, CGFLOAT_MAX};

@interface DTAccessibilityElement()
@property (nonatomic, DT_WEAK_PROPERTY) UIView *parentView;
@end
0 libobjc.A.dylib | objc_retain + 16
-- | --
1 AppName | -[DTAccessibilityElement accessibilityFrame] (DTAccessibilityElement.m:35)
2 UIAccessibility | -[NSObject(AXPrivCategory) _iosAccessibilityAttributeValue:] + 5064
3 UIAccessibility | __copyMultipleAttributeValuesCallback + 544
4 AXRuntime | ____AXXMIGCopyMultipleAttributeValues_block_invoke + 64
5 AXRuntime | __handleNonMainThreadCallback + 68
6 AXRuntime | _AXXMIGCopyMultipleAttributeValues + 360
7 AXRuntime | __XCopyMultipleAttributeValues + 396
8 AXRuntime | _mshMIGPerform + 272
9 CoreFoundation | ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 60
10 CoreFoundation | ___CFRunLoopDoSource1 + 596
11 CoreFoundation | ___CFRunLoopRun + 2360
12 CoreFoundation | CFRunLoopRunSpecific + 600
13 GraphicsServices | GSEventRunModal + 164
14 UIKitCore | -[UIApplication _run] + 1072
15 UIKitCore | UIApplicationMain + 168
16 AppName | main (main.m:17)
17 libdyld.dylib | _start + 4

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

2 participants