embedded frameworks and dyld failure
Anthony B Arthur
brianarthur at nc.rr.com
Fri Sep 28 02:33:24 PDT 2007
This is related to a question I posted a few days ago. Apologies if
this has already been answered, but I am not finding it. Running OSX
10.4.10 on intel.
Question:
I am trying to bundle an app with all resources embedded. I have
followed steps posted here - http://developer.apple.com/documentation/
MacOSX/Conceptual/BPFrameworks/Tasks/CreatingFrameworks.html#//
apple_ref/doc/uid/20002258-106880-BAJJBIEF, under the Using Separate
Xcode Projects For Each Target heading. The app runs fine locally
but when copied to another host (or just renaming the resource path
locally -- effectively hiding the frameworks so that I know the app
is loading the embedded ones) it fails. Here's a few lines of the
crash log:
**********
Host Name: decatur
Date/Time: 2007-09-28 04:47:01.642 -0400
OS Version: 10.4.10 (Build 8R2232)
Report Version: 4
Command: EstiKit
Path: /Users/aarthur/Desktop/EstiKit.app/Contents/MacOS/EstiKit
Parent: WindowServer [59]
Version: 0.1 (0.1)
PID: 21368
Thread: 0
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000000
Thread 0 Crashed:
0 <<00000000>> 0x00000000 0 + 0
1 com.apple.myApp 0x000028a9 start + 41
Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00000000 ebx: 0xbffffd74 ecx: 0x90001658 edx: 0x00000002
edi: 0xbffffd68 esi: 0xbffffd90 ebp: 0xbffffd48 esp: 0xbffffd0c
ss: 0x0000001f efl: 0x00010286 eip: 0x00000000 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
Binary Images Description:
0x1000 - 0x5fff com.apple.myApp 0.1 /Users/aarthur/Desktop/
EstiKit.app/Contents/MacOS/EstiKit
0x63000 - 0x6efff com.apple.yourcocoaframework 1.0 /Users/
aarthur/Desktop/EstiKit.app/Contents/Frameworks/EKFormKit.framework/
Versions/A/EKFormKit
0xc6000 - 0xcafff com.apple.yourcocoaframework 1.0 /Users/
aarthur/Desktop/EstiKit.app/Contents/Frameworks/GBAccess.framework/
Versions/A/GBAccess
0x205000 - 0x220fff com.apple.yourcocoaframework 1.0 /Users/
aarthur/Desktop/EstiKit.app/Contents/Frameworks/
EstiKitModel.framework/Versions/A/EstiKitModel
0x2d1000 - 0x2eafff com.apple.yourcocoaframework 1.0 /Users/
aarthur/Desktop/EstiKit.app/Contents/Frameworks/GBSketchKit.framework/
Versions/A/GBSketchKit
0x20000000 - 0x20003fff com.apple.yourcocoaframework 1.0 /Users/
aarthur/Desktop/EstiKit.app/Contents/Frameworks/GBAppKit.framework/
Versions/A/GBAppKit
0x8fe00000 - 0x8fe4afff dyld 46.12 /usr/lib/dyld
<snip>
0xb0000000 - 0xb000afff com.apple.yourcocoaframework 1.0 /Users/
aarthur/Desktop/EstiKit.app/Contents/Frameworks/GBBase.framework/
Versions/A/GBBase
**********
I've included the first few lines, and the last line of the log.
Observe that dyld is loading 5 frameworks (I think), but there should
be 6. The missing framework is the one listed on the last line. I
suspect that is the source of my problem, but not exactly sure.
Also, using otool -L on the app binary all 6 frameworks are linked:
decatur:~/Library/EmbeddingBldDir/EstiKitHidden aarthur$ otool -L
Development/EstiKit.app/Contents/MacOS/EstiKit
Development/EstiKit.app/Contents/MacOS/EstiKit:
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
(compatibility version 1.0.0, current version 11.0.0)
@executable_path/../Frameworks/EKFormKit.framework/Versions/
A/EKFormKit (compatibility version 1.0.0, current version 1.0.0)
@executable_path/../Frameworks/EstiKitModel.framework/
Versions/A/EstiKitModel (compatibility version 1.0.0, current version
1.0.0)
@executable_path/../Frameworks/GBAccess.framework/Versions/A/
GBAccess (compatibility version 1.0.0, current version 1.0.0)
@executable_path/../Frameworks/GBAppKit.framework/Versions/A/
GBAppKit (compatibility version 1.0.0, current version 1.0.0)
@executable_path/../Frameworks/GBBase.framework/Versions/A/
GBBase (compatibility version 1.0.0, current version 1.0.0)
@executable_path/../Frameworks/GBSketchKit.framework/
Versions/A/GBSketchKit (compatibility version 1.0.0, current version
1.0.0)
/System/Library/PrivateFrameworks/ZeroLink.framework/
Versions/A/ZeroLink (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 88.3.9)
**********
Can anyone please offer a clue to the solution here. Also, is there
a load order? GBBase is the most basic framework and if order counts
it should load first but it's unclear how to accomplish that. I re-
arranged the order in the app but kinda doubt that makes a difference.
Best,
--Brian
More information about the MacOSX-dev
mailing list