• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Crash in -URLByResolvingBookmarkData::::: in sandboxed app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Crash in -URLByResolvingBookmarkData::::: in sandboxed app


  • Subject: Crash in -URLByResolvingBookmarkData::::: in sandboxed app
  • From: Markus Spoettl <email@hidden>
  • Date: Wed, 19 Feb 2014 16:03:56 +0100

Hi,

I keep getting a crash in my sandboxed app when it terminates. It is not 100% reproducible, but it happens a couple of times a day while working on the app, both when run from Xcode and started from Finder.
Part of the termination cleanup requires me to decode a bookmark that was stored
in the user defaults previously (same app, same session).
NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"mykey"];

if ((data != nil) && ([data isKindOfClass:[NSData class]])) {
 BOOL stale = NO;
 result = [NSURL URLByResolvingBookmarkData:data
              options:NSURLBookmarkResolutionWithoutUI |
                      NSURLBookmarkResolutionWithoutMounting |
                      NSURLBookmarkResolutionWithSecurityScope
        relativeToURL:nil
  bookmarkDataIsStale:&stale
                error:&error];
}

I call this same method in various places and it works fine, but during app termination it sometimes just crashes.
Has anyone seen this? If so, is there any way to avoid it crashing like that?

I'm on OSX 10.8.5 with Xcode 4.6.3, base SDK is 10.7.

Regards
Markus

The exception details and callstack of the crash is this:

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000

Application Specific Information:
*** __CFTypeCollectionRetain() called with NULL; likely a collection has been corrupted ***
Performing @selector(terminate:) from sender NSMenuItem 0x7fb330c2aef0

#0	0x00007fff94b92711 in __CFTypeCollectionRetain ()
#1	0x00007fff94bbfac2 in __CFDictionaryRetainValue ()
#2	0x00007fff94b91b8a in __CFBasicHashAddValue ()
#3	0x00007fff94b98268 in CFBasicHashAddValue ()
#4	0x00007fff94bcbe5f in CFDictionaryCreate ()
#5	0x00007fff94bd273c in CFErrorCreateWithUserInfoKeysAndValues ()
#6	0x00007fff95107ff2 in reportErrorForURL(__CFError**, long, __CFURL const*) ()
#7	0x00007fff950ef037 in _CFURLCreateByResolvingBookmarkData ()
#8 0x00007fff94c4ae5e in +[NSURL URLByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:] () #9 0x0000000100113588 in -[MyController getURL] at /Users/markus/Projects/MyController.m:187
--
__________________________________________
Markus Spoettl
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Crash in -URLByResolvingBookmarkData::::: in sandboxed app
      • From: Andrew Madsen <email@hidden>
  • Prev by Date: Re: auto layout, 10.9, and NSScrollView and friends
  • Next by Date: Re: Animating UIScrollView frame change without moving contents
  • Previous by thread: gcl_create_dispatch_queue where is CL_DEVICE_TYPE_USE_DEVICE_ID
  • Next by thread: Re: Crash in -URLByResolvingBookmarkData::::: in sandboxed app
  • Index(es):
    • Date
    • Thread