[CRIU] [PATCH 8/8] test: zdtm -- Add test for alternative signal stack
Cyrill Gorcunov
gorcunov at gmail.com
Tue Jun 18 07:00:41 EDT 2013
On Tue, Jun 18, 2013 at 05:51:00PM +0400, Andrew Vagin wrote:
>
> Could you add one more process which will sleep in a signal handler which
> is executed on alt stack?
Sure, thanks for idea!
> > +
> > +static char stack_thread[SIGSTKSZ];
> > +static char stack_main[SIGSTKSZ];
> > +static stack_t sas_state[4];
>
> I whould prefer to have a comment here, which describe each element of
> sas_state.
indeed
> > +
> > + if (sigaltstack(&sas_state[0], NULL)) {
> > + err("sigaltstack");
> > + exit(-1);
>
> Should we use exit_group here?
No, it's thread leader anyway, I had to use exit_group in thread
for simplicity (that said using exit_group in thread leader is
safe as well but I though using plain exit() here will look
more unified with all other tests code). Just gimme a word if
you prefer to see exit_group over all places instead and i'll
fix it up.
> > +
> > + if (sascmp(&sas_state[0], &sas_state[1]) ||
> > + sascmp(&sas_state[0], &sas_state[1])) {
>
> sascmp(&sas_state[2], &sas_state[3])){
Darn! Thanks Andrew!
More information about the CRIU
mailing list