Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EXC_BAD_ACCESS (SIGSEGV) - KERN_INVALID_ADDRESS

I have uploaded the app and it get rejected saying

We found that your app crashed on iPad running iOS 7, which is not in compliance with the App Store Review Guidelines.

Well the time when I uploaded, iOS7 was not launched.

The crash report says

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xb1b1f20b

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x3a2f5b26 objc_msgSend + 6
1   MapKit                          0x30ca46a6 -[MKMapView mapViewDidFinishLoadingTiles:] + 46
2   VectorKit                       0x376bbaf4 -[VKTileSource didFinishWithNetwork] + 68
3   VectorKit                       0x376bc196 __32-[VKTileSource performDownload:]_block_invoke126 + 38
4   GeoServices                     0x345b6fdc ___ZNK49-[GEOTileLoaderInternal _loadedTile:forKey:info:]66__49-[GEOTileLoaderInternal _loadedTile:forKey:info:]_block_invoke3$_1clERKN8LoadItem9RequesterE_block_invoke_2 + 52
5   libdispatch.dylib               0x3a7ddd78 _dispatch_call_block_and_release + 8
6   libdispatch.dylib               0x3a7ddd64 _dispatch_client_callout + 20
7   libdispatch.dylib               0x3a7e47bc _dispatch_main_queue_callback_4CF$VARIANT$mp + 264
8   CoreFoundation                  0x2fab881c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 4
9   CoreFoundation                  0x2fab70f0 __CFRunLoopRun + 1296
10  CoreFoundation                  0x2fa21ce2 CFRunLoopRunSpecific + 518
11  CoreFoundation                  0x2fa21ac6 CFRunLoopRunInMode + 102
12  GraphicsServices                0x3471c27e GSEventRunModal + 134
13  UIKit                           0x322c3a3c UIApplicationMain + 1132

In crash we see MapKit 0x30ca46a6 -[MKMapView mapViewDidFinishLoadingTiles:].

Is MapKit is giving problem?

For mapkit, below is what I have

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title = @"Location";
    // Do any additional setup after loading the view.
    CLLocationCoordinate2D cords = {29.32511601390379, 48.08847418705136};
    MKCoordinateSpan span = {0.008400,0.008400};
    region = (MKCoordinateRegion) {cords,span};
    mapView.showsUserLocation = YES;
    [mapView setRegion:region animated:YES];
    [mapView setDelegate:self];

    DisplayMap *ann = [[DisplayMap alloc] init];
    ann.coordinate = region.center;
    [mapView addAnnotation:ann];
}

Also I don't have dealloc in mapkitviewcontroller. Is that fine? I am asking as this error is related to memory management.

My App was having 5 tabs. First 4 tabs are just UIWebView. For webview, I found that I didn't put webview in dealloc. Below is what I had in webview,

- (void)dealloc {
    [super dealloc];
}

Right now I don't have iOS 7 on my xcode too. I need to download that, but thought to ask before here.

Note: All is working perfectly with iOS 6.

Any guesses why I am getting this error?

like image 294
Fahim Parkar Avatar asked Oct 02 '22 20:10

Fahim Parkar


1 Answers

Did set the map view delegate to nil before navigating away from the page. Also I think there is some memory management issue with IOS maps. So It is better to release maps in the dealloc method.

like image 140
PgmFreek Avatar answered Oct 20 '22 16:10

PgmFreek