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

Crash when SecItemCopyMatching #155

Open
Firerage opened this issue Aug 10, 2017 · 6 comments
Open

Crash when SecItemCopyMatching #155

Firerage opened this issue Aug 10, 2017 · 6 comments

Comments

@Firerage
Copy link

I try to get password from UICKeyChainStore 2.1.0.This method

  • (NSData *)dataForKey:(NSString *)key error:(NSError *__autoreleasing *)error

crash when SecItemCopyMatching

Device Information:
iOS 10.3.3
iPhone6 Plus

@appsailor
Copy link

@kishikawakatsumi,

One of our apps is getting the following crash similar to this and its happening a lot.
Here is the crash details. Any help will be much appreciated.

cheers,
Aldrin

OS Version: 10.3.3 (14G60)

Device: iPhone 7

RAM Free: 1.1%

Disk Free: 91.9%

#0. Crashed: com.apple.main-thread
0 libsystem_malloc.dylib 0x1814796d8 szone_malloc_should_clear + 4
1 libsystem_malloc.dylib 0x18147c4e8 malloc_zone_calloc + 168
2 libsystem_malloc.dylib 0x18147c41c calloc + 40
3 libobjc.A.dylib 0x180eb8160 class_createInstance + 76
4 libdispatch.dylib 0x181302a18 _os_object_alloc_realized + 40
5 libdispatch.dylib 0x181305540 dispatch_mach_msg_create + 80
6 libdispatch.dylib 0x181319148 _dispatch_mach_send_and_wait_for_reply + 1152
7 libdispatch.dylib 0x1813192e8 dispatch_mach_send_with_result_and_wait_for_reply + 56
8 libxpc.dylib 0x181540edc xpc_connection_send_message_with_reply_sync + 196
9 Security 0x182864e44 securityd_message_with_reply_sync + 200
10 Security 0x182865114 securityd_send_sync_and_do + 80
11 Security 0x18288ac88 __SecItemCopyMatching_block_invoke_2 + 212
12 Security 0x18288c730 __SecItemAuthDoQuery_block_invoke + 304
13 Security 0x18288978c SecItemAuthDo + 1116
14 Security 0x18288a424 SecItemAuthDoQuery + 492
15 Security 0x18288aba8 __SecItemCopyMatching_block_invoke + 116
16 Security 0x182888c3c SecOSStatusWith + 52
17 Security 0x18288aaec SecItemCopyMatching + 396
18 UICKeyChainStore 0x101758334 -[UICKeyChainStore dataForKey:error:] + 208
19 UICKeyChainStore 0x101757c08 -[UICKeyChainStore stringForKey:error:] + 40

@kishikawakatsumi
Copy link
Owner

@Firerage @appsailor Could you provide a reproduction case?

@appsailor
Copy link

@kishikawakatsumi - false alarm, there was an infinite loop issue that resulted in this crash on our side. So fixed it after lots of trial and errors to narrow down the problem area. All good for now. Thanks!

@shanksGuo
Copy link

@kishikawakatsumi @appsailor so, is this problem solved? I met a dead lock when multi thread situation, one thread execute SecItemCopyMatching and another execute SecItemAdd.

@ninja342
Copy link

@shanksGuo we are facing with a similar problem can you explain how you detected deadlock and how did you fixed it?

@shanksGuo
Copy link

I can’t reproduce that, we met this problem when App Store review our App. Our solution is using dispatch_once because once is enough for us. For you, I guess you can use sync operation or serial queue.

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

5 participants