[llvm] [symbolizer] Empty string is not an error (PR #92660)

via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 13:59:36 PDT 2024


pcc wrote:

> Honetly, I feel like the requested "check that llvm-symbolizer is responding to input by sending it an arbitrary string" is a bit of a hack too: what if llvm-symbolizer were to crash immediately after printing its response?

> the use case is invalid as a good response doesn't mean that more responses will come from llvm-symbolizer (see above re. crash after a response for one possible example)

A good response means that the client program found the llvm-symbolizer executable and it reached its main loop, which is a useful thing to know on its own regardless of whether later requests fail. A bad response is a strong signal (not a guarantee) that there was a user error and the client program should tell the user to e.g. check their $PATH. A good response rules out this type of user error and means that if we see a crash later it means that there is a bug (either in the client program or llvm-symbolizer) and the client program can respond by telling the user to file a bug report. This is the case whether the crash was caused by responding to the `\n` or to the first request.

> What does binutils addr2line do in this case?

Looks like it prints `??:0\n` without any output to stderr. We might want to emulate that in the addr2line emulation mode but since llvm-symbolizer has historically responded to `\n` with `\n` I reckon that's what llvm-symbolizer should do by default.

https://github.com/llvm/llvm-project/pull/92660


More information about the llvm-commits mailing list