When the ROOT libraries are loaded, TUnixSystem installs signal handlers for various signals using the sigaction(2) mechanism.
While this is certainly desirable for interactive CINT sessions, it is often less welcome if one just links against the ROOT libraries – and many other libs beside – in some C++ program and relies on the standard signal handlers (which are now being overwritten) to handle core dump generation etc.
I can think of multiple ways to disable signal trapping by ROOT, but all of them are hacks and would require changing code in the program.
Thus, I propose an option in rootrc to disable signal trapping. Perhaps Root.CatchSignals (default true).
Alternatively, if I have overlooked some clean way to archive this, please point it out.
You can undo the signal setup done by TSystem by calling:
for (int sig = 0; sig < kMAXSIGNALS; sig++)
the Root.CatchSignals is a good suggestion. I’ve added it as a feature request.
It would be great if there was an easy way to turn off root’s signal handling in a single option. Has this been added?
Actually, since I’d rather be able to use root as a component in larger frameworks, even better would be if there was some way to disable all of root’s global environment tweaks by default so it acts like any other library. For example, in all my python scripts I have to include this:
There are probably other examples of unwelcome intervention from ROOT, it would be nice if there was a way to turn it all off.