Questions tagged [sigchld]
70 questions
0
votes
1 answer
How waitpid is better than wait when multiple SIGCHLDs are raised simultaneously?
In the book "Unix network programming, Volume 1" by Richard Stevens, in the section "Difference between wait vs waitpid", it says waitpid() should be used intead of wait(). I understand the problem described when using wait(). It says, when multiple…

Jayanth
- 115
- 1
- 11
0
votes
0 answers
What happens when you fork() from one of the created threads?
I'm trying to understand how the below works in Linux:
What happens when you fork() from one of the created threads?
what happens to other threads?
What happens when you fork() from the main thread (the thread/process calling fork)?
What happens…

user3479915
- 5
- 1
- 4
0
votes
0 answers
Django runserver memory leak?
Seemingly out of nowhere, whenever I called the url for my Django model, be it with ListView or DetailView, it would hang, and while doing so the memory would spike and I had to kill runserver. I have now tracked this issue down to…

Malik A. Rumi
- 1,855
- 4
- 25
- 36
0
votes
1 answer
Why is Net::SNMP::Dispatcher failing with "select() error [No child processes]"?
I need some help identifying, and eliminating, the cause of an odd child process error when polling SNMP services.
During SNMP connect, I verify SNMP connectivity by polling for the
device name until it times out:
sub snmp_close {
my $self =…

Chris R
- 17,546
- 23
- 105
- 172
0
votes
0 answers
c++ SIGCHLD create a wrong system call return
This is my code (it's just an example)
int a = system("pwd");
printf("pwd with return: %d\n", a);
cout << "errno is " << errno << "\n";
signal(SIGCHLD, SIG_IGN);
a = system("pwd");
printf("pwd with return: %d\n", a);
cout << "errno is " << errno…

Walter
- 67
- 12
0
votes
0 answers
How to read /proc/PID/maps of a child process just before the child process terminates
I'm trying to read memory usage(PSS, specifically) of a child process by reading its proc filesystem when the child process is about to be terminated.
Following this and this answers, I managed to hook SIGCHLD signal of child process and read some…

joybro
- 205
- 1
- 12
0
votes
1 answer
Can i get the signal int constant (like SIGINT or SIGKILL) that terminated a process using using sigaction's flag siginfo with SIGCHLD in C?
I'm trying to figure out if i can get the signal that terminated a child process using a custom SIGCHLD handler passed to a sigaction with flag set to SA_SIGINFO. From what i understood the si_status should report an exit value or a signal value…
user12196313
0
votes
0 answers
Capturing SIGCHLD and replacing terminated child
I am forking n number of children and saving each child's pid_t in a dynamically allocated table (yes i want to do that since I need the parent process to own these id's). My program should expect a SIGCHLD signal and when it recieves it, it must…

JamesTheProg
- 91
- 7
0
votes
1 answer
Sleep not working in child process after the popen function call
I have written a small C program which is creating a child process and then running a shell command using popen. I have created a signal handler to wait for the child process to end while the parent process just runs in an infinite loop. When I am…

pranav
- 163
- 1
- 3
- 12
0
votes
2 answers
Updating an array from main:: in a signal handler function (Perl)
I would like to maintain a pidlist array of children I have forked and then remove them as they exit (to restrict how many forked processes i have at any given time). I thought I might be clever and do this by using @main::pid_list in either a…

OregonJeff
- 13
- 2
0
votes
1 answer
Can't ignore signal CHLD, forcing to default
#include
#include
#include
#include
#include
#include
#include
int main(){
signal(SIGCHLD,SIG_IGN );
pid_t pid = vfork();
if(pid…

Debabrata Bardhan
- 21
- 5
0
votes
1 answer
Linux: how to program to monitor process existing/quiting?
SIGCHLD can only be caught by father process to monitor if child process exits. But I wish to write a stand-alone program to monitor some processes, if they quit, report a log immediately.
Is there any programming ways that I can use, rather than…

Troskyvs
- 7,537
- 7
- 47
- 115
0
votes
1 answer
BASH script exiting out before completion
I have a long bash script doing a number of things that reaches this point...
(at the end of a case statement)...
{
/usr/bin/expect << EOF
set timeout 120
spawn ssh -o StrictHostKeyChecking=no root@$AMHOST1$DOMAIN…

grunhutl
- 1
0
votes
0 answers
Seg Fault when SIGCHLD is caught in simple shell program
UPDATE:When I set act.sa_flags = SA_RESTART the program stops seg faulting however it causes the program to be "stuck" in that function, as in it doesn't move forward with the logic in my program. The colon indicates the beginning of a new command…

user2466886
- 205
- 1
- 3
- 14
0
votes
2 answers
Why we generally ignore SIGCHLD
I was studying about signals and going through this link
https://en.wikipedia.org/wiki/Child_process#cite_note-1
And this is what it says : "The SIGCHLD signal is sent to the parent of a child process when it exits, is interrupted, or resumes after…

pankaj kushwaha
- 369
- 5
- 20