obcj4/CFLite on Windows
obcj4/CFLite on Windows
- Subject: obcj4/CFLite on Windows
- From: Brent Fulgham <email@hidden>
- Date: Tue, 15 Sep 2009 18:27:15 -0700
Hi again,
To recap:
1. I am attempting to get CFLite up and running on Windows using the
10.6 source base.
2. I have successfully built objc4 for use with CFLite.
3. I have gotten CFLite (550) building on Windows.
4. CFLite (550) crashes on startup.
Originally I thought this was an issue with the objc4 library, but I
was able to confirm that I see the same crash when running with the
objc.dll that ships with Safari on Windows, and was likewise able to
use my own locally-built objc.dll with Safari without problems.
Therefore I assume my problem is in my CFLite build, and more
specifically in the initialization logic.
During program initialization (specifically CoreFoundation bundle
registration) CFlite attempts to convert a pathname into an array of
CFStrings containing the path components. Down a few layers in this
code, it fails:
objc_debug.dll!objc_msgSend(objc_object * a=0x6a363ff8,
objc_selector * b=0x0012ea8c, ...) Line 123 C
CFLite_Debug.dll!CFRetain(const void * cf=0x101e2768) Line 535 +
0x4c bytes C++
CFLite_Debug.dll!__CFStringCreateImmutableFunnel3(const
__CFAllocator * alloc=0x101e1060, const void * bytes=0x00c6ee10, long
numBytes=0, unsigned int encoding=1280, unsigned char
possiblyExternalFormat=0, unsigned char tryToReduceUnicode=0, unsigned
char hasLengthByte=0, unsigned char hasNullByte=0, unsigned char
noCopy=0, const __CFAllocator * contentsDeallocator=0x101e1060,
unsigned int converterFlags=0) Line 1224 + 0xb bytes C++
CFLite_Debug.dll!CFStringCreateWithSubstring(const __CFAllocator *
alloc=0x101e1060, const __CFString * str=0x00c6edc8, CFRange
range={...}) Line 1558 + 0x36 bytes C++
CFLite_Debug.dll!CFStringCreateArrayBySeparatingStrings(const
__CFAllocator * alloc=0x101e1060, const __CFString *
string=0x00c6edc8, const __CFString * separatorString=0x00c62158)
Line 3869 + 0x3a bytes C++
> CFLite_Debug.dll!WindowsPathToURLComponents(const __CFString * path=0x00c6edc8, const __CFAllocator * alloc=0x101e1060, unsigned char isDir='') Line 3485 + 0x1b bytes C++
CFLite_Debug.dll!WindowsPathToURLPath(const __CFString *
path=0x00c6edc8, const __CFAllocator * alloc=0x101e1060, unsigned char
isDir='') Line 3521 + 0x11 bytes C++
CFLite_Debug.dll!_convertToURLRepresentation(__CFURL *
url=0x00c61f90) Line 3620 + 0x14 bytes C++
CFLite_Debug.dll!CFURLGetString(const __CFURL * url=0x00c61f90)
Line 2383 + 0x9 bytes C++
CFLite_Debug.dll!_CFBundleURLLooksLikeBundleVersion(const __CFURL *
url=0x00c61f90, unsigned char * version=0x0012f377) Line 1842 + 0x17
bytes C++
CFLite_Debug.dll!_CFBundleCreate(const __CFAllocator *
allocator=0x101e1060, const __CFURL * bundleURL=0x00c621d8, unsigned
char alreadyLocked=0, unsigned char doFinalProcessing='') Line 1229
+ 0x13 bytes C++
CFLite_Debug.dll!CFBundleCreate(const __CFAllocator *
allocator=0x101e1060, const __CFURL * bundleURL=0x00c621d8) Line 1334
+ 0x11 bytes C++
CFLite_Debug.dll!RegisterCoreFoundationBundle() Line 1203 + 0x13 bytes C++
CFLite_Debug.dll!DllMain(HINSTANCE__ * hInstance=0x10000000,
unsigned long dwReason=1, void * pReserved=0x0012fd24) Line 1219 +
0x5 bytes C++
CFLite_Debug.dll!__DllMainCRTStartup(void * hDllHandle=0x10000000,
unsigned long dwReason=0, void * lpreserved=0x00000000) Line 498 +
0x8 bytes C
CFLite_Debug.dll!_DllMainCRTStartup(void * hDllHandle=0x76ef9083,
unsigned long dwReason=269031836, void * lpreserved=0x10000000) Line
462 + 0x11 bytes C
The failure happens when attempting to call CFRetain on a static empty
string CoreFoundation object:
CFString.c: Line 1224:
return CFRetain(kCFEmptyString); // Quick exit; won't catch all
empty strings, but most
Where kCFEmptyString is declared as:
CFString.c: Line 152:
CONST_STRING_DECL(kCFEmptyString, "")
This is the first attempt to call objc_msgSend in the program, and it
fails in the assembly logic where it is trying to perform a cache
lookup for the selector ("retain" in this case).
I'm wondering if perhaps the selector information is never getting
populated. I put a breakpoint in _objc_init_image and have not hit
this during startup, so I'm guessing that some kind of initialization
of the objc runtime is not happening. However, I don't see any
explicit calls to this initialization logic elsewhere, and the CFLite
in Darwin seems to work properly.
Any suggestions for where this initialization should be happening?
Thanks,
-Brent
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden