Llvm-symbolizer has gotten extremely slow

Does that help with lookup-by-address? I had thought that only helped with lookup-by-name.

So what’s the path forward here? If nobody is going to pick up an attempt at a solution, I think this needs to be reverted or put under an off by default flag.

A slight correction, since I had cause to look into this: not only sets LLVM_DISABLE_SYMBOLIZATION if you run it as not --crash.

I think this is really disruptive even if we hacked around this for XFAILEd tests. My workflow frequently includes adding broken tests and iterating from there, and adding things that will fail to see what tests break.

@hctim I think there is a perf issue here.

DWARFContext::getInliningInfoForAddress looks like it’s only intended for/actually symbolizes code, not data addresses, but it’s still paying the cost of indexing the global variables due to the change in getCompileUnitForAddress.

Please fix the perf issue by ensuring that getInliningInfoForAddress doesn’t incur the cost of indexing globals (& that cost is only incurred when doing a DATA 0x... symbolizer query, that goes through getCompileUnitForDataAddress)

Might be that the global variable lookup part of getCompileUnitForAddress should be pulled out of there and inlined into getLineInfoForDataAddress, the one place that needs/uses it, I think?

In my experience that does not work, because llvm-lit sanitizes the environment by unsetting most environment variables (including LLVM_DISABLE_SYMBOLIZATION) before running the commands on the RUN line.

Maybe it’s worth modifying lit to preserve the state of LLVM_DISABLE_SYMBOLIZATION, if it is set?

I’m still seeing prolonged symbolizer times even with 02e8eb1a438bdb1dc9a97aea75a8c9c748048039 (at last on Mac). If this is just going to be slow, it should be off by default under a flag

1 Like

I just ran into the same problem when I do a release+assert build with DebugInfo. I created a patch to improve the performance significantly (just a small change).

Feel free to review: ⚙ D156603 [SymbolSize] Improve the performance of SymbolSize computation