summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin <iCollin@users.noreply.github.com>2021-10-07 14:46:08 -0400
committerGitHub <noreply@github.com>2021-10-07 14:46:08 -0400
commit8306670b753ad64ae4704c701ef62077fadefe5b (patch)
tree7db736e8748c180c3bf4eef8a826d007ecc570b4
parent86e032f7829217f3a4c718e8d2d96c951c70a71c (diff)
downloadsdl_core-8306670b753ad64ae4704c701ef62077fadefe5b.tar.gz
print to console on crash from signal handler (#3789)
-rw-r--r--src/appMain/life_cycle_impl.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/appMain/life_cycle_impl.cc b/src/appMain/life_cycle_impl.cc
index 8b67877ac8..762f506814 100644
--- a/src/appMain/life_cycle_impl.cc
+++ b/src/appMain/life_cycle_impl.cc
@@ -237,12 +237,14 @@ void sig_handler(int sig) {
SDL_LOG_DEBUG("SIGTERM signal has been caught");
break;
case SIGSEGV:
+ std::cerr << "SIGSEGV caught" << std::endl;
SDL_LOG_DEBUG("SIGSEGV signal has been caught");
SDL_FLUSH_LOGGER();
// exit need to prevent endless sending SIGSEGV
// http://stackoverflow.com/questions/2663456/how-to-write-a-signal-handler-to-catch-sigsegv
abort();
default:
+ std::cerr << "Unexpected signal " << sig << " caught" << std::endl;
SDL_LOG_DEBUG("Unexpected signal has been caught");
exit(EXIT_FAILURE);
}