Re: [ROOT] Signal handlers and the like

From: Matt Palmer (palmer@hep.phy.cam.ac.uk)
Date: Mon Jan 12 2004 - 14:19:46 MET


Hi,
Thanks for the information, I think this will be enough to do what I want.

Matt

Fons Rademakers wrote:
> Hi Matt,
> 
>  this is the list of signals that are handled by default by ROOT:
> 
> kSigChild
> kSigBus
> kSigSegmentationViolation
> kSigIllegalInstruction
> kSigSystem
> kSigPipe
> kSigAlarm
> kSigUrgent
> kSigFloatingException
> kSigWindowChanged
> 
> The signals kSigBus, kSigSegmentationViolation, kSigIllegalInstruction
> and kSigFloatingException cause the printing of the *** Break ***
> message and make a long jump back to the ROOT prompt. No other custom
> TSignalHandlers can be added to these signals.
> 
> The kSigAlarm signal handles a-sync timers.
> 
> The kSigWindowChanged signal handles terminal window resizing
> 
> The other signals have no other behaviour then that any registered
> TSignalHandler::Notify()'s will be called.
> 
> When building in interactive application using the TRint object also the
> kSigInterrupt signal will be handled (message: "*** Break *** keyboard
> interrupt") plus long jump back to the ROOT command prompt. If no TRint
> object is created there will be no kSigInterrupt handling.
> 
> All signals can be reset to their default Unix behaviour using the call
> TSystem::ResetSignal(). All signals can be ignored using
> TSystem::IgnoreSignal() (TSystem::IgnoreInterrupt() is a utility
> function to toggle the handling of the interrupt signal. Typically
> TSystem::IgnoreInterrupt()  is called to prevent a SIGINT to interrupt
> some important call (like writing to ROOT file)).
> 
> If TRint is used and the default ROOT interrupt handler is not desired
> use TApplication::GetSignalHandler() to get the interrupt handler and to
> remove it using TSystem::RemoveSignalHandler().
> 
> Hope this is clear.
> 
> Cheers, Fons.
> 
> 
> PS: in some cases ROOT ends up in a situation where ctrl-c does nothing
> and one has to kill the ROOT session from another shell. This happens
> when ROOT ends up in a situation where the SIGINT had been set to be
> ignored. This is not desired and we are investigating the issue.
> 
> 
> 
> On Fri, 2004-01-09 at 13:56, Matt Palmer wrote:
> 
>>Hi,
>>I'm using ROOT as a library for a set of external applications.  It 
>>seems that ROOT automatically installs some signal handlers which I 
>>would much rather it didn't do for these applications.  Is there any way 
>>of stopping this behaviour?
>>
>>Also, does ROOT install unexpected exception handlers or do other things 
>>which may modify how programs they are linked to behave?
>>
>>Thanks,
>>Matt



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:05 MET