GithubHelp home page GithubHelp logo

Comments (2)

hkaiser avatar hkaiser commented on May 27, 2024

@Pansysk75 Thanks! The termination handlers are here:

namespace hpx {
///////////////////////////////////////////////////////////////////////////
void handle_termination(char const* reason)
{
if (hpx::threads::coroutines::attach_debugger_on_sigv)
{
util::attach_debugger();
}
if (hpx::threads::coroutines::diagnostics_on_terminate)
{
int const verbosity = hpx::threads::coroutines::exception_verbosity;
if (verbosity >= 2)
{
std::cerr << full_build_string() << "\n";
}
#if defined(HPX_HAVE_STACKTRACES)
if (verbosity >= 1)
{
std::size_t const trace_depth =
util::from_string<std::size_t>(get_config_entry(
"hpx.trace_depth", HPX_HAVE_THREAD_BACKTRACE_DEPTH));
std::cerr << "{stack-trace}: " << hpx::util::trace(trace_depth)
<< "\n";
}
#endif
std::cerr << "{what}: " << (reason ? reason : "Unknown reason")
<< "\n";
}
}
HPX_CORE_EXPORT BOOL WINAPI termination_handler(DWORD ctrl_type)
{
switch (ctrl_type)
{
case CTRL_C_EVENT:
handle_termination("Ctrl-C");
break;
case CTRL_BREAK_EVENT:
handle_termination("Ctrl-Break");
break;
case CTRL_CLOSE_EVENT:
handle_termination("Ctrl-Close");
break;
case CTRL_LOGOFF_EVENT:
handle_termination("Logoff");
break;
case CTRL_SHUTDOWN_EVENT:
handle_termination("Shutdown");
break;
default:
break;
}
return FALSE;
}
} // namespace hpx
#else
#include <signal.h>
#include <stdlib.h>
#include <string.h>
namespace hpx {
///////////////////////////////////////////////////////////////////////////
[[noreturn]] HPX_CORE_EXPORT void termination_handler(int signum)
{
if (signum != SIGINT &&
hpx::threads::coroutines::attach_debugger_on_sigv)
{
util::attach_debugger();
}
if (hpx::threads::coroutines::diagnostics_on_terminate)
{
int const verbosity = hpx::threads::coroutines::exception_verbosity;
char* reason = strsignal(signum);
if (verbosity >= 2)
{
std::cerr << full_build_string() << "\n";
}
#if defined(HPX_HAVE_STACKTRACES)
if (verbosity >= 1)
{
std::size_t const trace_depth =
util::from_string<std::size_t>(get_config_entry(
"hpx.trace_depth", HPX_HAVE_THREAD_BACKTRACE_DEPTH));
std::cerr << "{stack-trace}: " << hpx::util::trace(trace_depth)
<< "\n";
}
#endif
std::cerr << "{what}: " << (reason ? reason : "Unknown reason")
<< "\n";
}
std::abort();
}
} // namespace hpx
#endif

from hpx.

Pansysk75 avatar Pansysk75 commented on May 27, 2024

Issue resolved by PR #6340

from hpx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.