diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c6cf426eb561efe23c685b4b7df88e0623de720..7bcbe7fe9b1954684593b3202dfe365b369b9a3d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,7 +24,7 @@ include_directories(${PASTIS_SOURCE_DIR}/packages/CLI11/include)
 
 # Kokkos
 set(KOKKOS_ENABLE_OPENMP ON CACHE BOOL "")
-add_subdirectory(${CMAKE_SOURCE_DIR}/packages/kokkos)
+add_subdirectory(${PASTIS_SOURCE_DIR}/packages/kokkos)
 include_directories(${Kokkos_INCLUDE_DIRS_RET})
 
 # Pastis utils
@@ -46,6 +46,8 @@ configure_file("${PASTIS_SOURCE_DIR}/pastis_config.hpp.in"
   "${CMAKE_CURRENT_BINARY_DIR}/pastis_config.hpp"
   @ONLY)
 
+link_libraries("-rdynamic")
+
 # ------------------- Source files --------------------
 # Pastis binary
 add_executable(
diff --git a/utils/SignalManager.cpp b/utils/SignalManager.cpp
index f82d0f4e6336fa3b09211cae5be691f2eb79f0cc..4ef3fefc9dc689022641665bf2da8cd8c80e067e 100644
--- a/utils/SignalManager.cpp
+++ b/utils/SignalManager.cpp
@@ -4,6 +4,45 @@
 #include <rang.hpp>
 #include <iomanip>
 
+#include <execinfo.h>
+#include <cxxabi.h>
+#include <regex>
+#include <vector>
+
+void print_bt() {
+  const int size = 20;
+  void *buffer[size];
+
+  int ret = backtrace( buffer, size );
+  char **ptr = backtrace_symbols( buffer, ret );
+
+  std::vector<std::string> lines;
+  for (int i=0; i<ret; ++i) {
+    lines.push_back(ptr[i]);
+  }
+  
+  free( ptr );
+
+  // abi::__cxa_demangle( "_Z16displayBacktracev", NULL, NULL, &status );
+  std::regex mangled_function(R"(\(.*\+)");
+  for (const auto& line : lines) {
+    std::cerr << "demangling " << line << '\n';
+    std::smatch matchex;
+    int status = -1;
+    if (std::regex_search(line, matchex, mangled_function))  {
+      std::string prefix = matchex.prefix().str();
+      std::string function = line.substr(matchex.position()+1,matchex.length()-2);
+      std::string suffix = matchex.suffix().str();
+      std::cerr << "Found " << function.c_str() << '\n';
+      std::string demangled = abi::__cxa_demangle(function.c_str(), NULL, NULL, &status);
+      std::cerr << "status=" << status << '\n';
+      std::cerr << demangled << '\n'<< '\n';
+    }
+  }
+}
+
+
+
 #warning must create a specific class for pausing and use enum class
 #include <string>
 std::string SignalManager::s_pause_on_error = "auto";
@@ -27,6 +66,7 @@ std::string SignalManager::signalName(int s)
 
 void SignalManager::pauseForDebug()
 {
+
   std::cerr  << "\n======================================\n";
   std::cerr << rang::style::reset
 	    << rang::fg::reset
@@ -50,6 +90,7 @@ void SignalManager::pauseForDebug()
 
 void SignalManager::handler(int s)
 {
+
   std::cerr << "\n *** "
 	    << rang::style::reset
 	    << rang::fg::reset
@@ -62,18 +103,27 @@ void SignalManager::handler(int s)
 	    << rang::style::reset
 	    << " ***\n";
 
+  std::signal(SIGFPE,  SIG_DFL);
+  std::signal(SIGSEGV, SIG_DFL);
+  std::signal(SIGTERM, SIG_DFL);
+  std::signal(SIGINT,  SIG_DFL);
+  std::signal(SIGABRT, SIG_DFL);
+
+  print_bt();
+  
+  SignalManager::pauseForDebug();
   if ((ConsoleManager::isTerminal(std::cout) and
        (s_pause_on_error == "auto")) or
       (s_pause_on_error == "yes")) {
-    std::signal(SIGINT, SIG_DFL);
     SignalManager::pauseForDebug();
   } else {
-    std::exit(0);
+    // std::exit(0);
   }
  }
 
 void SignalManager::init(const bool& enable)
 {
+
   if (enable) {
     std::signal(SIGFPE,  SignalManager::handler);
     std::signal(SIGSEGV, SignalManager::handler);