Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Avoid adding SegfaultLogger if process already has sig handler. #13842

Merged
merged 1 commit into from
Jan 15, 2019
Merged
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
6 changes: 5 additions & 1 deletion src/initialize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ class LibraryInitializer {
LibraryInitializer() {
dmlc::InitLogging("mxnet");
#if MXNET_USE_SIGNAL_HANDLER && DMLC_LOG_STACK_TRACE
signal(SIGSEGV, SegfaultLogger);
struct sigaction sa;
sigaction(SIGSEGV, NULL, &sa);
if (sa.sa_handler == NULL) {
signal(SIGSEGV, SegfaultLogger);
}
#endif

// disable openmp for multithreaded workers
Expand Down