mstange / samply

Command-line sampling profiler for macOS and Linux
Apache License 2.0
1.96k stars 48 forks source link

Don't look up symbols for all-zero debug IDs. #283

Closed mstange closed 2 days ago

mstange commented 2 days ago

All-zero debug IDs are sometimes created when no debug ID is available. Looking up symbols based on such a nil debug ID is never going to yield useful symbols, and could even cause existing useful symbols to be discarded.

In practice, if you were importing a simpleperf profile on a macOS machine which had a clone of the LLVM repo on its hard drive, the imported profile would lose all its Java function names after symbolication.

This happened due to the following comedy of errors:

With this patch, a symbolication request with an all-zeros debug ID will just fail with an "invalid breakpad ID" error, and the existing symbols for the library will be preserved.