Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

kill signal sometimes can't be received

kill signal sometimes can't be received

kill signal sometimes can't be received

I wrote a multi-thread application. in thread A, i called kill as below to send a SIGTERM signal.

kill(getpid(), SIGTERM)

in thread B, I have following code to wait for the SIGTERM signal.

sigset_t waitsignalset;
// Add whatever signal(s) to be processed by this routine
sigaddset(&waitsignalset, SIGINT);
sigaddset(&waitsignalset, SIGQUIT);
sigaddset(&waitsignalset, SIGTERM);

// Examine and Change Blocked Signals
sigprocmask(SIG_BLOCK, &waitsignalset, NULL);
result = sigwait(&waitsignalset, &sig);

I also called sigaction to register my signal handling method. however, the problem I am having is that sometimes, the sigwait can't get the SIGTERM signal, I need to let thread A to send the SIGTERM signal again to let sigwait get the signal.

Anyone might have any clue on why this happened? thanks in advance.

RE: kill signal sometimes can't be received

I'm unaware of any recent version of 'ps' failing to identify zombies.
Both /usr/bin/ps and /usr/ucb/ps should do so properly.

$ perl -e 'if (fork()) {sleep 20;}' &
[1] 15091
$ /usr/bin/ps -ef | grep def
root 15092 15091 0 0:00 <defunct>
$ /usr/ucb/ps ax| grep def
15092 Z 0:00 <defunct>

Bug in kernel, bug in driver, limitation in driver.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close