On Tue, 2011-10-11 at 16:18 -0700, Matt Helsley wrote:
> lxc init modifies a different signal mask in the loop than the one it's
> installing with sigaction in the loop. It appears that either these
> lines should move outside the loop, or the intent was to clear the
> bits of the sa_mask instead of the mask.
> 
> Signed-off-by: Matt Helsley <matth...@us.ibm.com>
> 
> Should the same mask bits be cleared from the mask set with
> sigprocmask prior to sigprocmask() above? (won't show up in diff
> context, sorry)
> ---

Good catch... but, honestly I wander why we even care for these signals.
The interrupt_handler() function is unlikely to trigger them and
lxc-init runs only one thread... :-\

I guess the sigdelset lines could simply be killed.

>  src/lxc/lxc_init.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/lxc/lxc_init.c b/src/lxc/lxc_init.c
> index a534b51..b111494 100644
> --- a/src/lxc/lxc_init.c
> +++ b/src/lxc/lxc_init.c
> @@ -101,9 +101,9 @@ int main(int argc, char *argv[])
>               struct sigaction act;
> 
>               sigfillset(&act.sa_mask);
> -             sigdelset(&mask, SIGILL);
> -             sigdelset(&mask, SIGSEGV);
> -             sigdelset(&mask, SIGBUS);
> +             sigdelset(&act.sa_mask, SIGILL);
> +             sigdelset(&act.sa_mask, SIGSEGV);
> +             sigdelset(&act.sa_mask, SIGBUS);
>               act.sa_flags = 0;
>               act.sa_handler = interrupt_handler;
>               sigaction(i, &act, NULL);

-- 
Gregory Kurz                                     gk...@fr.ibm.com
Software Engineer @ IBM/Meiosys                  http://www.ibm.com
Tel +33 (0)534 638 479                           Fax +33 (0)561 400 420

"Anarchy is about taking complete responsibility for yourself."
        Alan Moore.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to