Open ritchie7 opened 2 years ago
I found a few problems with this issue:
Thanks for reporting, @ritchie7. Please fill out the needed information from the template so we could try to reproduce the issue.
CocoaPods
iOS
In my project, object is a real obj for NSURLSession's NSProxy, and class_copyIvarList([object class], &count) is the function that gets the real object (NSURLSession instance). When the code reaches object_getIvar(), an EXC_BAD_ACCESS crash will occur.
// The implementation of `NSProxy1`/`NSProxy2` and GULProxy is the same.
+ (NSURLSession *)swizzling_sharedSession {
NSURLSession *session = [NSProxy1 proxyWithTarget:[self swizzling_sharedSession]];
return session;
}
+ (NSURLSession *)swizzling_sessionWithConfiguration:(NSURLSessionConfiguration *)configuration
delegate:(id<NSURLSessionDelegate>)delegate
delegateQueue:(NSOperationQueue *)queue {
id delegateProxy = [NSProxy2 proxyWithTarget:delegate];
NSURLSession *session = [self swizzling_sessionWithConfiguration:configuration
delegate:delegateProxy
delegateQueue:queue];
return (id<NSObject>)[NSProxy1 proxyWithTarget:session];
}
Thanks
Does removing FirebasePerformance make a difference?
Thank you for your reply. If firebasePerformance is removed, the crash will not occur, because
-[FPRNSURLSessionInstrument registerProxyObject:]
is not executed.
Thanks. I'll assign to the Performance team for investigation.
In my project, object is a real obj for NSURLSession's NSProxy, and
class_copyIvarList([object class], &count)
is the function that gets the real object (NSURLSession instance). When the code reachesobject_getIvar()
, an EXC_BAD_ACCESS crash will occur.thanks.