This is an automated email from the ASF dual-hosted git repository.

zhasheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 3a46980  Use USE_SIGNAL_HANDLER by default set to ON in CMakeLists.txt 
(#14599)
3a46980 is described below

commit 3a4698058840ff79e58709b6135c8fb757a99606
Author: Pedro Larroy <pedro.larroy.li...@gmail.com>
AuthorDate: Mon Apr 29 19:22:03 2019 -0700

    Use USE_SIGNAL_HANDLER by default set to ON in CMakeLists.txt (#14599)
    
    * Use USE_SIGNAL_HANDLER by default set to ON in CMakeLists.txt
    
    * Fix lint error with NULL vs nullptr
---
 CMakeLists.txt    | 2 +-
 src/initialize.cc | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d014e96..37836c2 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)
diff --git a/src/initialize.cc b/src/initialize.cc
index 00a736a..7236ced 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

Reply via email to