简体   繁体   中英

I don't understand this iOS stack trace from BugSense/Mint… where is my code actually crashing at?

My app here is named Movies . I am using Splunk Mint (formerly BugSense) to capture crash reports. I recently updated to their new 4.0 SDK. Here is a crash report today that I don't understand. At what line exactly is the crash happening in my code?

Crash is: NSInvalidArgumentException *** -[NSPlaceholderString initWithString:]: nil argument

You would think line #4? But I have no idea what the heck URLBlackListManager is. Or is it line #0, a crash inside of MKSKProduct (the code I've been using for years to make in-app purchases easy), but then why would it say it's coming from CoreFoundation ? Or is it line #10, the last line that Movies actually gets called with my code?

And I have NO clue what SplunkNSURLConnectionSendSynchronousRequestReturningResponseError is and their website doesn't have any info on it.

I have been unable to report the crash, but it's happened at least 10 times on different devices for different people.

I'm a bit confused... anyone have any ideas?

0   CoreFoundation  -[MKSKProduct verifyReceiptOnComplete:onError:] (in Movies) (MKSKProduct.m:196) + 868307    
1   libobjc.A.dylib _mh_execute_header (in Movies) + 15567  
2   CoreFoundation  -[MKSKProduct verifyReceiptOnComplete:onError:] (in Movies) (MKSKProduct.m:190) + 868117    
3   Foundation  -[CollectionViewController collectionView:didSelectItemAtIndexPath:] (in Movies) (CollectionViewController.m:227) + 154361  
4   Movies  -[URLBlackListManager containsURL:] (in Movies) + 129   
5   Movies  SplunkNSURLConnectionSendSynchronousRequestReturningResponseError (in Movies) + 453 
6   Foundation  -[SettingsViewController tableView:didSelectRowAtIndexPath:] (in Movies) (SettingsViewController.m:278) + 292459    
7   Foundation  -[SettingsViewController tableView:didSelectRowAtIndexPath:] (in Movies) (SettingsViewController.m:270) + 292251    
8   Foundation  +[MKSKProduct connection:didFailWithError:] (in Movies) (MKSKProduct.m:299) 
9   Movies  -[iPhoneRSS initWithURL:andItemName:] (in Movies) (iPhoneRSS.m:39) + 871897 
10  Movies  -[CreateUsernameViewController submit:] (in Movies) (CreateUsernameViewController.m:123) + 572531   
11  UIKit   -[ImportViewController setUrlTextField:] (in Movies) (ImportViewController.m:34) + 262231   
12  UIKit   -[ImportViewController setInstructionsLabel:] (in Movies) (ImportViewController.m:32) + 262135  
13  UIKit   -[ImportViewController instructionsLabel] (in Movies) (ImportViewController.m:32) + 262097  
14  UIKit   __43-[CollectorsAdViewController openAppStore:]_block_invoke (in Movies) (CollectorsAdViewController.m:279) + 177975    
15  UIKit   -[ImportViewController ebaySearchWithCountry:andBarcode:] (in Movies) (ImportViewController.m:2464) + 260687    
16  UIKit   -[ImportViewController ebaySearchWithCountry:andBarcode:] (in Movies) (ImportViewController.m:2427) + 259873    
17  UIKit   -[ImportViewController importCollectorzData:] (in Movies) (ImportViewController.m:1488) + 239339    
18  UIKit   -[WishlistViewController tableView:commitEditingStyle:forRowAtIndexPath:] (in Movies) (WishlistViewController.m:1187) + 63725   
19  UIKit   -[WishlistViewController tableView:cellForRowAtIndexPath:] (in Movies) (WishlistViewController.m:929) + 57239   
20  CoreFoundation  -[MainViewController optionsTouched:] (in Movies) (MainViewController.m:687) + 651867   
21  CoreFoundation  -[MainViewController startActivityIndicator] (in Movies) (CGGeometry.h:294) + 649003    
22  CoreFoundation  -[MainViewController loadUp] (in Movies) (MainViewController.m:405) + 642847    
23  CoreFoundation  -[WishlistViewController themeSetup] (in Movies) (WishlistViewController.m:224) + 32527 
24  CoreFoundation  -[WishlistViewController loadDataOffline] (in Movies) (WishlistViewController.m:214) + 31987    
25  GraphicsServices    -[WishlistViewController loadUp] (in Movies) (WishlistViewController.m:412) + 38499 
26  UIKit   -[EditImageViewController viewWillAppear:] (in Movies) (EditImageViewController.m:102) + 450925 
27  Movies  main (in Movies) (main.m:16) + 891191   
28  libdyld.dylib   _mh_execute_header (in Movies) + 6839

Here's the verifyReceiptOnComplete code by the way from line #0 in the stack trace... let me know if you see any possible way to get a nil NSString crash anywhere here:

- (void) verifyReceiptOnComplete:(void (^)(void)) completionBlock
                         onError:(void (^)(NSError*)) errorBlock
{
  self.onReceiptVerificationSucceeded = completionBlock;
  self.onReceiptVerificationFailed = errorBlock;

  NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", OWN_SERVER, @"verifyProduct.php"]];

    NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url 
                                                            cachePolicy:NSURLRequestReloadIgnoringCacheData 
                                                        timeoutInterval:60];

    [theRequest setHTTPMethod:@"POST"];     
    [theRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];

    NSString *receiptDataString = [self.receipt base64EncodedString];

    NSString *postData = [NSString stringWithFormat:@"receiptdata=%@", receiptDataString];

    NSString *length = [NSString stringWithFormat:@"%d", [postData length]];    
    [theRequest setValue:length forHTTPHeaderField:@"Content-Length"];  

    [theRequest setHTTPBody:[postData dataUsingEncoding:NSASCIIStringEncoding]];

  self.theConnection = [NSURLConnection connectionWithRequest:theRequest delegate:self];    
  [self.theConnection start];   
}

Just stumbled upon this bug myself and here is what I found:

If you use Cocoapods to install Splunk Mint Express, you get two different Pods:

$> pod search Splunk

-> SplunkMint (4.0.4)
   Usage, performance and crash monitoring for your iOS apps
   pod 'SplunkMint', '~> 4.0.4'
   - Homepage: https://mint.splunk.com/
   - Source:   download.splunk.com/misc/mint/SplunkMint-iOS.framework.zip
   - Versions: 4.0.4, 4.0.3, 4.0.2, 4.0.1 [master repo]


-> SplunkMint-iOS (4.0.21)
   Usage, performance and crash monitoring for your iOS apps
   pod 'SplunkMint-iOS', '~> 4.0.21'
   - Homepage: https://mint.splunk.com/
   - Source:   download.splunk.com/misc/mint/SplunkMint-iOS.framework.4.0.21.zip
   - Versions: 4.0.21, 4.0.17, 4.0.1 [master repo]

When I was using SplunkMint I had the same crash but switching to SplunkMint-iOS fixed it. I don't know what the differences are between the two Pods (I didn't even have to change my code initializing Mint ) but I filed a bug to Splunk to let them know about it.

I will edit my post if I find something else,

Hope this will help,

Update: Splunk Mint (formerly BugSense) is investigating. They said there may be a bug and that is why you can see SplunkNSURLConnectionSendSynchronousRequestReturningResponseError and URLBlackListManager in there. I'll edit in what they ultimately have to say.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM