llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.44k stars 11.76k forks source link

llvm-nm take too long time when HFlags & MH_NLIST_OUTOFSYNC_WITH_DYLDINFO #93944

Open NianJi opened 4 months ago

NianJi commented 4 months ago

https://github.com/llvm/llvm-project/blob/de32a3df354f1d01c0a5c81285ac786cea9d8bdf/llvm/tools/llvm-nm/llvm-nm.cpp#L1267

Llvm-nm may get stuck for a long time when reading some mach-o files and cannot return.

After my debugging, I found that it got stuck in the code above. Got big two for loops

image
llvmbot commented 4 months ago

@llvm/issue-subscribers-tools-llvm-nm

Author: fengnianji (NianJi)

https://github.com/llvm/llvm-project/blob/de32a3df354f1d01c0a5c81285ac786cea9d8bdf/llvm/tools/llvm-nm/llvm-nm.cpp#L1267 Llvm-nm may get stuck for a long time when reading some mach-o files and cannot return. After my debugging, I found that it got stuck in the code above. Got big two for loops <img width="1298" alt="image" src="https://github.com/llvm/llvm-project/assets/1732749/cb8c7dfd-d229-4f0d-a75a-1e89f5a7c33b">
keith commented 4 months ago

I've seen this too. Do you have a good binary we can test on?