From ee2c6853b6d05977cbd0cee1be5a606cda3aec13 Mon Sep 17 00:00:00 2001 From: Pedro Larroy Date: Tue, 2 Apr 2019 13:30:06 -0700 Subject: [PATCH 1/2] Use USE_SIGNAL_HANDLER by default set to ON in CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e582bae5e95..b20196acaf8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ mxnet_option(USE_VTUNE "Enable use of Intel Amplifier XE (VTune)" OFF mxnet_option(ENABLE_CUDA_RTC "Build with CUDA runtime compilation support" ON) mxnet_option(BUILD_CPP_EXAMPLES "Build cpp examples" ON) mxnet_option(INSTALL_EXAMPLES "Install the example source files." OFF) -mxnet_option(USE_SIGNAL_HANDLER "Print stack traces on segfaults." OFF) +mxnet_option(USE_SIGNAL_HANDLER "Print stack traces on segfaults." ON) mxnet_option(USE_TENSORRT "Enable infeference optimization with TensorRT." OFF) mxnet_option(USE_ASAN "Enable Clang/GCC ASAN sanitizers." OFF) mxnet_option(ENABLE_TESTCOVERAGE "Enable compilation with test coverage metric output" OFF) From 5a79cda23074b02001f9cc7685aa31abbe8b4cd9 Mon Sep 17 00:00:00 2001 From: Pedro Larroy Date: Wed, 10 Apr 2019 21:27:24 +0000 Subject: [PATCH 2/2] Fix lint error with NULL vs nullptr --- src/initialize.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/initialize.cc b/src/initialize.cc index 00a736abd8ba..7236ced52e93 100644 --- a/src/initialize.cc +++ b/src/initialize.cc @@ -46,8 +46,8 @@ class LibraryInitializer { dmlc::InitLogging("mxnet"); #if MXNET_USE_SIGNAL_HANDLER && DMLC_LOG_STACK_TRACE struct sigaction sa; - sigaction(SIGSEGV, NULL, &sa); - if (sa.sa_handler == NULL) { + sigaction(SIGSEGV, nullptr, &sa); + if (sa.sa_handler == nullptr) { signal(SIGSEGV, SegfaultLogger); } #endif