Skip to content

Commit

Permalink
Use USE_SIGNAL_HANDLER by default set to ON in CMakeLists.txt (apache…
Browse files Browse the repository at this point in the history
…#14599)

* Use USE_SIGNAL_HANDLER by default set to ON in CMakeLists.txt

* Fix lint error with NULL vs nullptr
  • Loading branch information
larroy authored and haohuw committed Jun 23, 2019
1 parent 35069d5 commit 063ff2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/initialize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 063ff2a

Please sign in to comment.