[PATCH] D113717: [Symbolizer][Debuginfo] Add debuginfod client to llvm-symbolizer.

Noah Shutty via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 12:05:31 PST 2021


noajshu marked an inline comment as done.
noajshu added inline comments.


================
Comment at: llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp:265-266
   InitLLVM X(argc, argv);
+  // The HTTPClient must be initialized for use by the debuginfod client.
+  HTTPClient::initialize();
   sys::InitializeCOMRAII COM(sys::COMThreadingMode::MultiThreaded);
----------------
jhenderson wrote:
> Could we RAII this somehow, so that the explicit cleanup at the end isn't needed? Also, I below the typical user won't be using the debuginfod client, so maybe it should be lazily initialized?
Good idea, I've RAII'd the cleanup!

I would like to lazily initialize the client, but I'm not sure we can. There's a relevant [[ https://reviews.llvm.org/D112753#inline-1083341 | discussion here ]] about why we need to run `curl_global_init` at the beginning of main, when there is only one thread.
Although we could move the `HTTPClient::init` to one of llvm-symbolizer's functions, I'm concerned this function could get called from another program from within a thread. By calling at the beginning of main() we don't have to worry about that.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113717/new/

https://reviews.llvm.org/D113717



More information about the llvm-commits mailing list