1313#include < vespa/fnet/transport.h>
1414#include < vespa/fastos/file_interface.h>
1515#include < absl/debugging/failure_signal_handler.h>
16+ #include < absl/debugging/symbolize.h>
1617#include < filesystem>
1718#include < iostream>
1819#include < thread>
@@ -43,7 +44,7 @@ Params::~Params() = default;
4344class App
4445{
4546private:
46- static void setupSignals ();
47+ static void setupSignals (char **argv );
4748 static void setup_fadvise ();
4849 Params parseParams (int argc, char **argv);
4950 void startAndRun (FNET_Transport & transport, int argc, char **argv);
@@ -52,8 +53,12 @@ class App
5253};
5354
5455void
55- App::setupSignals ()
56+ App::setupSignals (char **argv )
5657{
58+ // Ensure that symbolizer global setup/allocation happens prior to any invocations of
59+ // the symbolizer itself. Otherwise, we risk nested failures when the symbolizer attempts
60+ // to allocate internal structures when processing an abort-signal caused by an OOM.
61+ absl::InitializeSymbolizer (argv[0 ]);
5762 absl::FailureSignalHandlerOptions opts;
5863 // Sanitizers set up their own signal handler, so we must ensure that the failure signal
5964 // handler calls this when it's done, or we won't get a proper report.
325330App::main (int argc, char **argv)
326331{
327332 try {
328- setupSignals ();
333+ setupSignals (argv );
329334 setup_fadvise ();
330335 FastOS_FileInterface::enableFSync ();
331336 Transport transport (buildTransportConfig ());
0 commit comments