MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / on_signal

Function on_signal

tests/fuzztests/fuzztests.cpp:649–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

647static std::mutex g_signal_handler_mutex;
648
649void on_signal(int signal)
650{
651 if (reported_signal_error.test_and_set()) {
652 return;
653 }
654
655 std::unique_lock<std::mutex> lock(g_signal_handler_mutex);
656 auto seed = g_seed.load(std::memory_order_acquire);
657
658 // Technically undefined behaviour to use stdlib functions,
659 // but oh well
660 const char* error = signal == SIGABRT ?
661 "Abort detected (assertion failed?)" :
662 "Segmentation fault detected!";
663
664 {
665 std::ofstream fout(LOG_FILE, std::ios::app);
666 fout << "*** " << error << "\n Seed: " << std::hex << seed << std::endl;
667 }
668 std::printf("*** %s\n Seed: %08x%08x\n", error, (uint32_t)(seed >> 32), (uint32_t)(seed));
669 std::fflush(stdout);
670}
671
672extern "C" void signal_handler(int signal)
673{

Callers 2

signal_handlerFunction · 0.85
se_handlerFunction · 0.85

Calls 2

test_and_setMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected