- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- C process zombies managment
Operating System - Linux
1753792
Members
7105
Online
108799
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2008 02:41 AM
тАО05-07-2008 02:41 AM
C process zombies managment
Hello,
I have the following problem on hp-ux 11i platform.
In a C process I trap the SIGCHLD signals and manage them in a dedicaded routine through waitpid function:
signal(SIGCHLD, SigExit);
...
void SigExit(int sig)
{
int status;
int local_pid;
....
switch(sig)
{
...
case SIGCHLD:
while ((local_pid = waitpid(-1, &status, WNOHANG)) > 0)
{
...
}
signal(sig, SigExit);
return;
break;
}
}
The children processes terminations are correclty trapped, but randomically some zombies processes are generated.
Could someone help me?
Many thanks.
Giuseppe Fedele
I have the following problem on hp-ux 11i platform.
In a C process I trap the SIGCHLD signals and manage them in a dedicaded routine through waitpid function:
signal(SIGCHLD, SigExit);
...
void SigExit(int sig)
{
int status;
int local_pid;
....
switch(sig)
{
...
case SIGCHLD:
while ((local_pid = waitpid(-1, &status, WNOHANG)) > 0)
{
...
}
signal(sig, SigExit);
return;
break;
}
}
The children processes terminations are correclty trapped, but randomically some zombies processes are generated.
Could someone help me?
Many thanks.
Giuseppe Fedele
- Tags:
- zombie
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2008 09:29 PM
тАО05-07-2008 09:29 PM
Re: C process zombies managment
You may have to use sigaction(2) instead of signal(2). sigaction allows you to block the signal so you don't have multiple signals coming at the same time.
Also, the waitpid(2) says that waitpid(...,, WNOHANG) sometimes returns 0.
If it returns -1, you might want to check errno is ECHILD.
Also, the waitpid(2) says that waitpid(...,, WNOHANG) sometimes returns 0.
If it returns -1, you might want to check errno is ECHILD.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-08-2008 02:30 AM
тАО05-08-2008 02:30 AM
Re: C process zombies managment
Ok, thanks.
A further question: does signal function have problems in multithread environment?
Because this is my case.
Giuseppe
A further question: does signal function have problems in multithread environment?
Because this is my case.
Giuseppe
- Tags:
- pthread
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-08-2008 09:39 AM
тАО05-08-2008 09:39 AM
Re: C process zombies managment
>Does signal function have problems in multithread environment?
That may explain why sigaction and blocking will fix it.
That may explain why sigaction and blocking will fix it.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP