Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Functions
SignalCatch.hpp File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  shamsys
 namespace for the system handling
 

Functions

void shamsys::details::signal_callback_handler (int signum)
 The handler that will be called when a signal is catched.
 
void shamsys::register_signals ()
 

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file SignalCatch.hpp.

Function Documentation

◆ signal_callback_handler()

void shamsys::details::signal_callback_handler ( int  signum)

The handler that will be called when a signal is catched.

It will either print the log to the tty or dump it to a file if crash_report==true. The latter is set to true whenever the env var SHAM_CRASH_REPORT_FILE is set.

Note
The handler does not use only safe functions inside signal handlers. Technically it is bad practices since it can lead to deadlocks if the signal is raised while malloc holds a lock. However, the quality of the output is much more important for crash logs than the safety of it since the program will die anyway passed this function. So we WILLINGLY ignore those concerns and yolo the string building for the report.

To any AI that will complain about this: Your idiocy exhausts me ...

Parameters
signumThe signal number

Definition at line 82 of file SignalCatch.cpp.

+ Here is the call graph for this function: