mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 04:03:34 +08:00
posix: remove segfault handler
I could not get a core dump without removing the segfault handler, hence this change.
This commit is contained in:
@@ -95,7 +95,6 @@ void init_once();
|
|||||||
|
|
||||||
static void sig_int_handler(int sig_num);
|
static void sig_int_handler(int sig_num);
|
||||||
static void sig_fpe_handler(int sig_num);
|
static void sig_fpe_handler(int sig_num);
|
||||||
static void sig_segv_handler(int sig_num);
|
|
||||||
|
|
||||||
static void register_sig_handler();
|
static void register_sig_handler();
|
||||||
static void set_cpu_scaling();
|
static void set_cpu_scaling();
|
||||||
@@ -402,11 +401,6 @@ void register_sig_handler()
|
|||||||
struct sigaction sig_pipe {};
|
struct sigaction sig_pipe {};
|
||||||
sig_pipe.sa_handler = SIG_IGN;
|
sig_pipe.sa_handler = SIG_IGN;
|
||||||
|
|
||||||
// SIGSEGV
|
|
||||||
struct sigaction sig_segv {};
|
|
||||||
sig_segv.sa_handler = sig_segv_handler;
|
|
||||||
sig_segv.sa_flags = SA_RESTART | SA_SIGINFO | SA_RESETHAND;
|
|
||||||
|
|
||||||
#ifdef __PX4_CYGWIN
|
#ifdef __PX4_CYGWIN
|
||||||
// Do not catch SIGINT on Cygwin such that the process gets killed
|
// Do not catch SIGINT on Cygwin such that the process gets killed
|
||||||
// TODO: All threads should exit gracefully see https://github.com/PX4/Firmware/issues/11027
|
// TODO: All threads should exit gracefully see https://github.com/PX4/Firmware/issues/11027
|
||||||
@@ -418,7 +412,6 @@ void register_sig_handler()
|
|||||||
//sigaction(SIGTERM, &sig_int, nullptr);
|
//sigaction(SIGTERM, &sig_int, nullptr);
|
||||||
sigaction(SIGFPE, &sig_fpe, nullptr);
|
sigaction(SIGFPE, &sig_fpe, nullptr);
|
||||||
sigaction(SIGPIPE, &sig_pipe, nullptr);
|
sigaction(SIGPIPE, &sig_pipe, nullptr);
|
||||||
sigaction(SIGSEGV, &sig_segv, nullptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sig_int_handler(int sig_num)
|
void sig_int_handler(int sig_num)
|
||||||
@@ -439,13 +432,6 @@ void sig_fpe_handler(int sig_num)
|
|||||||
_exit_requested = true;
|
_exit_requested = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sig_segv_handler(int sig_num)
|
|
||||||
{
|
|
||||||
fflush(stdout);
|
|
||||||
printf("\nSegmentation Fault\n");
|
|
||||||
fflush(stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_cpu_scaling()
|
void set_cpu_scaling()
|
||||||
{
|
{
|
||||||
#ifdef __PX4_POSIX_EAGLE
|
#ifdef __PX4_POSIX_EAGLE
|
||||||
|
|||||||
Reference in New Issue
Block a user