> Thread 1 Thread 2 > dlopen malloc > ... takes loader lock ... takes malloc lock > malloc _Unwind_Backtrace > ... needs malloc lock dl_iterate_phdr > held by T2 ... needs loader lock held by T1
Am I missing something, or wouldn't it be feasible when instrumenting malloc to call _Unwind_Backtrace before obtaining the malloc lock (or drop the malloc lock while calling _Unwind_Backtrace)? Similarly, couldn't dlopen drop the loader lock while calling malloc? -cary