Issue on Mac OS X Lion #14

Closed
dgdosen opened this Issue Aug 21, 2011 · 6 comments

Projects

None yet

5 participants

@dgdosen
dgdosen commented Aug 21, 2011

Have you tried building and running on Lion?

I've got two different machine running Lion, and while I can build the static libs and frameworks for Cedar on both, My spec app (and the iPhoneSpecs app in the Cedar project) crash when loading:

void CDRDefineGlobalBeforeAndAfterEachBlocks() {
    [SpecHelper specHelper].globalBeforeEachClasses = CDRSelectClasses(^BOOL(Class class) { return !!class_getClassMethod(class, @selector(beforeEach)); });
    [SpecHelper specHelper].globalAfterEachClasses = CDRSelectClasses(^BOOL(Class class) { return !!class_getClassMethod(class, @selector(afterEach)); });
}

where the first line makes a call to ___CFBasicHashFindBucket_Linear

Any guidance?

@joncooper

I have what appears to be the same issue running iPhoneSpecs on Snow Leopard.

I get a crash and a thread dump, with a stack trace that looks like:

0 ___CFBasicHashFindBucket_Linear
6911 look_up_method
6912 __CDRDefineGlobalBeforeAndAfter...
6913 CDRSelectClasses
6914 CDRDefineGlobalBeforeAndAfter...
6915 runSpecsWithCustomExampleRe...
6916 -[CDRExampleReporterViewCont...
6917 -[NSThread main]

XCode 4.0.2 build 4A2002a; OS X 10.6.8, current patchlevel.

@joncooper

iPhone emulator 4.3

@akitchen
Member

I don't believe this has anything to do with SL vs. Lion. We run on both versions of OS X without any OS-specific issues.

Without more info, my best guess is that this issue may be related to the recent change which removes the -beforeEach and -afterEach instance methods on SpecHelper, replacing them with a mechanism which discovers classes which implement a +beforeEach and +afterEach and runs your custom setup and teardown methods instead.

Let us know if this helps. Additionally, you might get help more quickly by posting to the cedar-discuss mailing list. Github issues aren't always actively monitored.

HTH,
Andrew

@pivotal
pivotal commented Nov 1, 2011

As Andrew mentioned, we run on Snow Leopard and Lion without problems. Based on the location of the crash, the problem appears to be some class which doesn't properly support the class_getClassMethod() runtime function. There's a known problem with the class UIAccessibilitySafeCategory__NSObject, which Apple provides when using an iOS device or simulator with the Accessibility Inspector enabled. Cedar has handled that issue since commit 6ace9c9 (8th of September).

If you can track down which class is causing this problem, we can try to figure out the cause. There doesn't seem to be a problem with enumerating the class itself, so you may be able to print out the name of each class in the loops using the class_getName() function. The last class name you print out before the crash should be the one that's causing the problem.

@dgdosen
dgdosen commented Nov 1, 2011

I'm working with this project today - I'll let you know! WIll use the other list for further questions...

@amilligan

Anyone have updates on this issue? I've still never seen it on any machine I use.

@pivotal pivotal closed this Dec 12, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment