iPhone Simulator crashes on starting app linked against libresolv

Originator:tobias.klonk
Number:rdar://10464051 Date Originated:17-Nov-2011 09:07 PM
Status:Duplicate/10474613 Resolved:
Product:iPhone SDK Product Version:5.0
Classification:Crash Reproducible:Always
 
Summary:

When trying to launch an application that was linked with libresolv.dylib in the iPhone Simulator 5.0 the app crashes with stack trace:

#0	0x00000000 in <????> ()
#1	0x94eaaef3 in mig_get_reply_port ()
#2	0x94ea470c in mach_ports_lookup ()
#3	0x00fbd124 in _xpc_domain_init_local ()
#4	0x00fbaeb1 in _libxpc_initializer ()
#5	0x8fe7d15b in __dyld__ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE ()
#6	0x8fe7ccc0 in __dyld__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE ()
#7	0x8fe7a220 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
#8	0x8fe7a1b6 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
#9	0x8fe7a1b6 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
#10	0x8fe7a1b6 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
#11	0x8fe7a1b6 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
#12	0x8fe7a1b6 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
#13	0x8fe7a1b6 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
#14	0x8fe7b1c0 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextERNS_21InitializerTimingListE ()
#15	0x8fe6f656 in __dyld__ZN4dyld24initializeMainExecutableEv ()
#16	0x8fe73ef2 in __dyld__ZN4dyld5_mainEPK12macho_headermiPPKcS5_S5_ ()
#17	0x8fe6d2ef in __dyld__ZN13dyldbootstrap5startEPK12macho_headeriPPKclS2_ ()
#18	0x8fe6d063 in __dyld__dyld_start ()


Steps to Reproduce:

Create a new iPhone/iPad app using Xcode with any template.
Either
     add -lresolv to Other Linker Flags in Build Settings
Or
     add libresolv.dylib to the "Link Binary with Libraries" Build Phase

Build and Run the App in Simulator 5.0

Expected Results:

The App should not crash.

Actual Results:

The App crashes with aforementioned stack trace.

Regression:

The app works as expected in the iPhoneSimulator 4.3 that ships with Xcode 4.2
The app works as expected in all simulator versions I used before Xcode4.2
The app works as expected on a device with iOS 5.0
The app works as expected on a device with any iOS4.x
The app used to work as expected on devices with iOS 2.x - 3.x before I dropped support.

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!