This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Thread exit leaves zombies ...................


As per your suggestion , I am not using sigprocmask( ) in my test case , as
you said the use of sigprocmask()

is undefined in multi-threaded program.Instead of sigprocmask() , I am
using pthread_sigmask ( ) , however

I am still getting the bug . (pthread_sigmask ( ) can be used in
multi-threaded programming ).

Can you suggest something regarding the failure of pthread_sigmask ( ) in
my test case.

Expecting a reply.

Thanks & Regards
Manoj Nayak

                    Ulrich Drepper                                                      
                    <drepper@redha       To:     Manoj Nayak/India/IBM@IBMIN            
          >               cc:, Khoa    
                    Sent by:              Huynh/Austin/IBM@IBMUS                        
                    drepper@myware       Subject:     Re: Thread exit leaves zombies    
                    .mynet                ...................                           
                    12:03 AM                                                            
                    Please respond                                                      
                    to drepper                                                          

"Manoj Nayak" <> writes:

> After sending signal to child threads & main thread ,manager thread
> dies .However main thread is not killed in response to manager
> thread's signal as it has already blocked that signal & at the same
> time main thread is not waiting ( in a waitpid() call ) for manager
> thread to free any system resource used by manager thread. That's
> why manager thread becomes zombie.
> This is rectified by passing __pthread_sig_cancel as one of flags to
> clone () system call.

Your expectations are wrong.  And the test program, btw: you are not
allowed to use sigprocmask() in multi-threaded applications.

The Unix/POSIX standard says:

  When a signal is delivered to a thread, if the action of that signal
  specifies termination, stop, or continue, the entire process shall
  be terminated, stopped, or continued, respectively.

I.e., blocking signal 2 in one thread must not prevent the thread from
being killed if any other thread accepts the signal with the
termination action and gets such a signal delivered.

This does not mean the current implementation is correct.  It isn't.
But your patch isn't doing to right thing.  I see no possibility to
fix this in the moment.  The signal handling the kernel implements is
not sufficient.

---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at   `------------------------

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]