[CRIU] [PATCH] dump: don't call rollback actions from a signal handler

Andrew Vagin avagin at virtuozzo.com
Fri Feb 19 14:42:00 PST 2016


On Fri, Feb 19, 2016 at 01:17:12PM +0300, Pavel Emelyanov wrote:
> On 02/19/2016 12:30 AM, Andrey Vagin wrote:
> > From: Andrew Vagin <avagin at virtuozzo.com>
> > 
> > We can do this, but we need to be sure that all structures
> > are consistant in any moment and we need to block alarm when
> > they are inconsistant.
> > 
> > I don't think that we really want to do this now. I suggest to
> > interupt a current syscall if an alarm signal is triggered.
> 
> What if alarm fires between system calls? Can we use siglongjump to
> handle it?

I was thinking about it, but I can't find a place where I would like to
jump in a error case:)

> 
> 
> > +static void alarm_handler(int signo)
> > +{
> > +	static int cnt = 5;
> > +
> > +	pr_err("Timeout reached. Try to interrupt: %d\n", signo);
> > +	if (cnt--) {
> > +		alarm(1);
> > +		/* A curren syscall will be exited with EINTR */
> > +		return;
> > +	}
> 
> Add a message here, that we're exiting w/o any .
> 
> > +	exit(1);
> > +}
> 


More information about the CRIU mailing list