When Try won't catch / CFURLCreateByResolvingBookmarkData

Not a beta issue…
I released an update to my app the other day. I didn’t change any of the security bookmark code, but app is now hard crashing when accessing the same saved bookmark data as prior version. The prior version can still access the bookmark data. This is only an issue for some users of course- ie, I can’t reproduce crash.

I did put a Try/Catch around offending code, but the crash is lower level than RB’s exception handling level.

PS: Also testing really long posts :slight_smile:

[quote]Process: PocketMoney [417]
Path: /Applications/PocketMoney.app/Contents/MacOS/PocketMoney
Identifier: com.catamount.pocketmoneymac
Version: 2.0.13 (2.0.13.3.319)
Code Type: X86 (Native)
Parent Process: launchd [173]
User ID: 501

Date/Time: 2013-03-02 17:11:17.428 +0700
OS Version: Mac OS X 10.8.2 (12C3006)
Report Version: 10

Interval Since Last Report: 672816 sec
Crashes Since Last Report: 60
Per-App Interval Since Last Report: 4 sec
Per-App Crashes Since Last Report: 6
Anonymous UUID: 035D997E-2C2B-D8DC-46B4-3F3A1F2DBF22

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

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

Application Specific Information:
*** __CFTypeCollectionRetain() called with NULL; likely a collection has been corrupted ***

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.apple.CoreFoundation 0x9705e6cc __CFTypeCollectionRetain + 44
1 com.apple.CoreFoundation 0x9708e83f __CFDictionaryRetainValue + 47
2 com.apple.CoreFoundation 0x9705db85 __CFBasicHashAddValue + 1189
3 com.apple.CoreFoundation 0x97064b81 CFBasicHashAddValue + 2657
4 com.apple.CoreFoundation 0x9709b597 CFDictionaryCreate + 135
5 com.apple.CoreFoundation 0x970a1767 CFErrorCreateWithUserInfoKeysAndValues + 135
6 com.apple.CoreServicesInternal 0x9a2722eb reportErrorForURL(__CFError**, long, __CFURL const*) + 95
7 com.apple.CoreServicesInternal 0x9a256f7e _CFURLCreateByResolvingBookmarkData + 2088
8 com.catamount.pocketmoneymac 0x00a93c79 securityScopedBookmarks.restoreFileFromBookmarkData%o%so + 3658
9 com.catamount.pocketmoneymac 0x0031326c App.OpenDatabase%b%oo + 2151
10 com.catamount.pocketmoneymac 0x0030aedf App.Event_Open%%o + 2865
11 rbframework.dylib 0x00cae6e5 0xc58000 + 354021
12 com.catamount.pocketmoneymac 0x00018b83 Delegate.Invoke%% + 34
13 com.catamount.pocketmoneymac 0x000b6605 Application._CallFunctionWithExceptionHandling%%op + 248
14 rbframework.dylib 0x00cdc3b4 0xc58000 + 541620
15 rbframework.dylib 0x00cad41a 0xc58000 + 349210
16 com.catamount.pocketmoneymac 0x0027bd29 REALbasic._RuntimeRegisterAppObject%%o + 48
17 com.catamount.pocketmoneymac 0x000028e2 _NewAppInstance + 238
18 com.catamount.pocketmoneymac 0x00004639 _Startup + 52
19 com.catamount.pocketmoneymac 0x002ca1b6 Delegate.Invoke%%p + 48
20 com.catamount.pocketmoneymac 0x0027b5f8 REALbasic._CallFunctionWithExceptionHandling%o%pp + 211
21 rbframework.dylib 0x00d5951f 0xc58000 + 1053983
22 com.apple.Foundation 0x96386c52 __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_0 + 49
23 com.apple.CoreFoundation 0x9714ce01 ___CFXNotificationPost_block_invoke_0 + 257
24 com.apple.CoreFoundation 0x9709843a _CFXNotificationPost + 2794
25 com.apple.Foundation 0x9636f788 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92
26 com.apple.Foundation 0x9637f527 -[NSNotificationCenter postNotificationName:object:] + 55
27 com.apple.AppKit 0x94d469cc -[NSApplication finishLaunching] + 465
28 rbframework.dylib 0x00d59c12 0xc58000 + 1055762
29 com.apple.AppKit 0x94d46439 -[NSApplication run] + 196
30 rbframework.dylib 0x00d59c93 0xc58000 + 1055891
31 rbframework.dylib 0x00cdc437 0xc58000 + 541751
32 rbframework.dylib 0x00cad4d2 RuntimeRun + 50
33 com.catamount.pocketmoneymac 0x0027be05 REALbasic._RuntimeRun + 34
34 com.catamount.pocketmoneymac 0x00004785 _Main + 245
35 com.catamount.pocketmoneymac 0x00002664 % main + 36
36 com.catamount.pocketmoneymac 0x00a9e88e _start + 116
37 com.catamount.pocketmoneymac 0x00a9e7e4 start + 43
[…shortened to be able to post…]
[/quote]

Try/Catch isn’t meant to handle outright crashes. At that point, the application is in such a state that resuming it to try to invoke user code is a really bad idea.