4

My code is built with a base SDK of 5.1 and deployment of 4.0 and is built using ARC.

I've not experienced any problems previously when running it on a 4.3 test device, however its just crashed for the first time.

Any idea how to fix it?

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x00000001, 0xe7ffdefe
Crashed Thread:  0

Dyld Error Message:
  Symbol not found: _objc_retainAutoreleasedReturnValue
  Referenced from: /var/mobile/Applications/6AD37C1A-9642-4F0A-87E9-ED33EE45729D/Interactive Messages.app/Interactive Messages
  Expected in: /usr/lib/libobjc.A.dylib
  Dyld Version: 191.3

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   dyld                            0x2fe01080 dyld_fatal_error + 0
1   dyld                            0x2fe02a40 dyld::halt(char const*) + 48
2   dyld                            0x2fe02b00 dyld::fastBindLazySymbol(ImageLoader**, unsigned long) + 172
3   libdyld.dylib                   0x351d544e _dyld_fast_stub_entry(void*, long) + 30
4   libdyld.dylib                   0x351d5374 dyld_stub_binder + 12
5   Interactive Messages            0x00036aee 0x1000 + 219886
6   libobjc.A.dylib                 0x350af5d4 call_load_methods + 96
7   libobjc.A.dylib                 0x350af446 load_images + 50
8   dyld                            0x2fe03d7c _ZN4dyldL12notifySingleE17dyld_image_statesPK11ImageLoader + 64
9   dyld                            0x2fe0a6a8 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 236
10  dyld                            0x2fe0aaaa ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 34
11  dyld                            0x2fe020dc dyld::initializeMainExecutable() + 324
12  dyld                            0x2fe06ffe dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**) + 1446
13  dyld                            0x2fe01286 dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*) + 506
14  dyld                            0x2fe01058 _dyld_start + 48
3
  • Probably the same thing as this question? stackoverflow.com/questions/8756418/… Commented Jul 18, 2012 at 23:51
  • That was a linker error, mine is a runtime error. Commented Jul 19, 2012 at 14:46
  • 1
    None of the answers below seem to talk about a solution. Did you manage to fix this problem? Commented Jan 13, 2013 at 3:04

3 Answers 3

1

Where was the crash happening? I had the same thing suddenly start happening with the new compiler.

For me I had the code inside a +(void) load override which seemed to have been called before the arclite code was properly linked. I'm not sure this is possible, but moving the same code into +(void) initialize worked fine.

Sign up to request clarification or add additional context in comments.

Comments

0

[This use to say 4.3 but I was wrong, all documentation says it iOS 4.]

EDIT: Grrr - I started my project a year ago, and wanted to use ARC and blocks. At that time I had some strong reason to use 4.3 not older releases, had to get permission from management, and it was all smooth sailing from then on. Now, I cannot determine why I did this. It's possible that at that time, the SDK was 4.3, and I made the assumption that is what I needed. I strongly recall I had a good reason to request 4.3 (I had just come back from WWDC) but now of course I cannot find anything to substantiate my answer. That said, the original poster seems to have given me the answer for this - so assume changing to 4.3 fixed his run time issue. If I ever find the reason I'll update this answer.

4 Comments

Why does this answer say ARC is supported on 4.0+ but need to set deployment as 4.3? Doesn't setting as 4.3 mean it can't be installed on 4.0? Therefore how is it supported for 4.0? stackoverflow.com/questions/7747783/…
Wrong - ARC is supported from iOS 4.0. From Apple docs... ARC is supported in Xcode 4.2 for Mac OS X v10.6 and v10.7 (64-bit applications) and for iOS 4 and iOS 5. Weak references are not supported in Mac OS X v10.6 and iOS 4.
If you'll note the EDIT, I clearly stated the answer was wrong - but left it for posterity (since its what I had originally stated.) Since people seem to read the first line and not the EDIT text, I changed the top line to make it 100% clear.
Well, he marked it as the answer since it did solve his problem - updating to 4.3 fixed it. That said, he must have had some other issue if in fact ARC is supported in 4.0. In any case I updated the answer.
0

I agree with @Paul de Lange, and let me add some more note.

I am not 100% sure, but it seems runtime mechanism has been slightly changed since Xcode 4.4, that ARC-enabled project will start linking libarclite_xxx.a (for iOS4) AFTER class's +(void)load is called (previously, it was BEFORE).

In more detail, method call goes like this in Xcode <= 4.3:

  1. LINKING libarclite_xxx.a
  2. class's +load
  3. class category's +load
  4. int main()
  5. class's +initialize

and in Xcode >= 4.4:

  1. class's +load
  2. LINKING libarclite_xxx.a
  3. class category's +load
  4. int main()
  5. class's +initialize

My app crashed on initial launch due to the addition of @autoreleasepool directly in class's +load, and by moving its implementation to either class's +initialize or class category's +load, everything went all fine.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.