Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions searchcore/src/apps/proton/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ vespa_add_executable(searchcore_proton_app
searchcore_proton_metrics
storageserver_storageapp
absl::failure_signal_handler
absl::symbolize
)
11 changes: 8 additions & 3 deletions searchcore/src/apps/proton/proton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <vespa/fnet/transport.h>
#include <vespa/fastos/file_interface.h>
#include <absl/debugging/failure_signal_handler.h>
#include <absl/debugging/symbolize.h>
#include <filesystem>
#include <iostream>
#include <thread>
Expand Down Expand Up @@ -43,7 +44,7 @@ Params::~Params() = default;
class App
{
private:
static void setupSignals();
static void setupSignals(char **argv);
static void setup_fadvise();
Params parseParams(int argc, char **argv);
void startAndRun(FNET_Transport & transport, int argc, char **argv);
Expand All @@ -52,8 +53,12 @@ class App
};

void
App::setupSignals()
App::setupSignals(char **argv)
{
// Ensure that symbolizer global setup/allocation happens prior to any invocations of
// the symbolizer itself. Otherwise, we risk nested failures when the symbolizer attempts
// to allocate internal structures when processing an abort-signal caused by an OOM.
absl::InitializeSymbolizer(argv[0]);
absl::FailureSignalHandlerOptions opts;
// Sanitizers set up their own signal handler, so we must ensure that the failure signal
// handler calls this when it's done, or we won't get a proper report.
Expand Down Expand Up @@ -325,7 +330,7 @@ int
App::main(int argc, char **argv)
{
try {
setupSignals();
setupSignals(argv);
setup_fadvise();
FastOS_FileInterface::enableFSync();
Transport transport(buildTransportConfig());
Expand Down
1 change: 1 addition & 0 deletions storageserver/src/apps/storaged/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vespa_add_executable(storageserver_storaged_app
storageserver_storageapp
protobuf::libprotobuf
absl::failure_signal_handler
absl::symbolize
)

vespa_add_target_package_dependency(storageserver_storaged_app Protobuf)
Expand Down
5 changes: 4 additions & 1 deletion storageserver/src/apps/storaged/storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <vespa/vespalib/util/signalhandler.h>
#include <google/protobuf/message_lite.h>
#include <absl/debugging/failure_signal_handler.h>
#include <absl/debugging/symbolize.h>
#include <iostream>
#include <csignal>
#include <cstdlib>
Expand Down Expand Up @@ -214,8 +215,10 @@ int StorageApp::main(int argc, char **argv)
} // storage

int main(int argc, char **argv) {
// See `App::setupSignals` in `searchcore/src/apps/proton/proton.cpp` for
// parameter and handler ordering rationale for the Abseil integration.
absl::InitializeSymbolizer(argv[0]);
absl::FailureSignalHandlerOptions opts;
// See `searchcore/src/apps/proton/proton.cpp` for parameter and handler ordering rationale.
opts.call_previous_handler = true;
opts.use_alternate_stack = false;
absl::InstallFailureSignalHandler(opts);
Expand Down
Loading