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

I've had a crash in this line by using RNCryptor library #22

Open
decim92 opened this issue Sep 10, 2018 · 4 comments
Open

I've had a crash in this line by using RNCryptor library #22

decim92 opened this issue Sep 10, 2018 · 4 comments

Comments

@decim92
Copy link

decim92 commented Sep 10, 2018

if (range.location < self.length) {

Setting <= self.length fixed the crash but I don't know whether something else will be broken or not

@jasenhuang
Copy link
Owner

@kiritoxcii would you show the demo code or paste crash stack?

@leo4developer
Copy link

I have the same problem,the crash stack:2019-03-01 17:11:51.292927+0800 AndClient Chinamobile[8572:2364047] /Users/ningliu/AndClient-iOS/AndClient/Extensions/Safe/NSObjectSafe.m|-[NSMutableData(Safe) hookReplaceBytesInRange:withBytes:]|1005|hookReplaceBytesInRange:withBytes: range.location error
2019-03-01 17:11:51.292992+0800 AndClient Chinamobile[8572:2364047] *** Assertion failure in -[NSConcreteMutableData replaceBytesInRange:withBytes:], /Users/ningliu/AndClient-iOS/AndClient/Extensions/Safe/NSObjectSafe.m:1005
2019-03-01 17:11:51.294340+0800 AndClient Chinamobile[8572:2364047] dynamic_cast error 2: One or more of the following type_info's has hidden visibility. They should all have public visibility. N10__cxxabiv116__shim_type_infoE, id, N10__cxxabiv117__pbase_type_infoE.
2019-03-01 17:11:51.294367+0800 AndClient Chinamobile[8572:2364047] dynamic_cast error 2: One or more of the following type_info's has hidden visibility. They should all have public visibility. N10__cxxabiv116__shim_type_infoE, id, N10__cxxabiv117__pbase_type_infoE.
2019-03-01 17:11:51.333728+0800 AndClient Chinamobile[8572:2364047] [Bugly] Trapped uncaught exception 'NSInternalInconsistencyException', reason: 'hookReplaceBytesInRange:withBytes: range.location error'
[
"0 CoreFoundation 0x000000021b1a0edc + 252",
"1 libobjc.A.dylib 0x000000021a371a40 objc_exception_throw + 56",
"2 CoreFoundation 0x000000021b0b6b3c + 0",
"3 Foundation 0x000000021bba51d0 + 112",
"4 AndClient Chinamobile 0x0000000100a45ea4 -[NSMutableData(Safe) hookReplaceBytesInRange:withBytes:] + 448",
"5 Foundation 0x000000021bbc1ccc + 88",
"6 AndClient Chinamobile 0x0000000100adeaf4 __23-[RNEncryptor addData:]_block_invoke + 160",
"7 libdispatch.dylib 0x0000000103683824 _dispatch_call_block_and_release + 24",
"8 libdispatch.dylib 0x0000000103684dc8 _dispatch_client_callout + 16",
"9 libdispatch.dylib 0x000000010368ce6c _dispatch_lane_serial_drain + 720",
"10 libdispatch.dylib 0x000000010368db60 _dispatch_lane_invoke + 460",
"11 libdispatch.dylib 0x0000000103697bfc _dispatch_workloop_worker_thread + 1220",
"12 libsystem_pthread.dylib 0x000000021adbd0dc _pthread_wqthread + 312",
"13 libsystem_pthread.dylib 0x000000021adbfcec start_wqthread + 4"
]

@jasenhuang
Copy link
Owner

@leo4developer @kiritoxcii actually, it's Assertion failure inside NSObjectSafe because of replaceBytesInRange with range.location == data.length,the default behavior of system api will append bytes to target.change to <= self.length is right.

@leo4developer
Copy link

@leo4developer @kiritoxcii actually, it's Assertion failure inside NSObjectSafe because of replaceBytesInRange with range.location == data.length,the default behavior of system api will append bytes to target.change to <= self.length is right.

谢谢!

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

3 participants