firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

Get rid of objc blocks inside dyld callback

Open wowlocal opened this issue 3 years ago • 0 comments

Objc blocks may hit curtain methods that will try to aquire objc runtime lock. At the same time _dyld_register_func_for_add_image called once for each image that is currently part of the program and that critical section is protected by dyld internal lock. In addition, objc runtime often goes into dyld e.g. objc_copyImageNames calling dyld_image_path_containing_address with objc runtimeLock locked: https://github.com/apple-oss-distributions/objc4/blob/rel/objc4-838/runtime/objc-runtime-new.mm#L5540 Lock/Unlock policies between dyld and objc worlds looks uncertain and dangerous. It is better to avoid objc runtime inside dyld callback.

wowlocal avatar Jul 14 '22 22:07 wowlocal