Skip to content

Commit

Permalink
Don't install crash handlers when using a debug build
Browse files Browse the repository at this point in the history
Application-side crash handling causes problems with debuggers
  • Loading branch information
maksis committed Nov 9, 2024
1 parent 51f5d8c commit 7ba0fb8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions airdcppd/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,22 @@ static void installHandler() {
signal(SIGINT, &breakHandler);
signal(SIGTERM, &breakHandler);

signal(SIGPIPE, SIG_IGN);

#ifndef _DEBUG
signal(SIGBUS, &handleCrash);
signal(SIGFPE, &handleCrash);
signal(SIGSEGV, &handleCrash);
signal(SIGILL, &handleCrash);

signal(SIGPIPE, SIG_IGN);

// Note: separate from SIGTERM
std::set_terminate([] {
handleCrash(0);
});
#else
std::cout << "Note: using debug build, crash handlers not installed" << std::endl;
#endif

}

static void setPidFilePath(const string& aConfigPath, const dcpp::StartupParams& aStartupParams) {
Expand Down

0 comments on commit 7ba0fb8

Please sign in to comment.