- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- SIG_IGN does not work
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
тАО08-05-2009 10:20 AM
тАО08-05-2009 10:20 AM
SIG_IGN does not work
compiler:
aCC:
HP aC++/C for Integrity Servers B3910B A.06.10 [Mar 22 2006]
We spawn multiple child processes from parent process.
and use the code below to avoid zombies
struct sigaction sa;
sa.sa_handler = SIG_IGN;
sa.sa_flags = SA_NOCLDWAIT;
if (sigaction(SIGCHLD, &sa, NULL) == -1) {
perror("sigaction");
exit(1);
}
Our application is POSIX compliant.
The above code cleaned up child process entries from process table when terminated.
This was working all along.
Now we had an occurance where it stopped working leaving behind many defunct (zombies).
Is there a way to work around to this?
The parent process cannot wait until child returns since many many clients depend on the parent server process and this will hold additional requests to the parent process.
The defunct processes where owned by the same user as parent process.
Please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-05-2009 10:46 AM
тАО08-05-2009 10:46 AM
Re: SIG_IGN does not work
There is a script which terminates the parent and child are killed using kill -9.
We use Orbix and parent and child are Orbix services. Orbix daemon starts a new parent process and child.
The defunct process creation started after the above script execution and continued until parent was killed forcefully.
All the defunct were owned by parent.
Killing parent killed all the defunct processes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2009 02:04 AM
тАО08-06-2009 02:04 AM
Re: SIG_IGN does not work
Is this a global? If a local, are you clearing the sa_mask field with sigemptyset(3)?
>Killing parent killed all the defunct processes
Yes, killing the zombie master allows init(1m) to reap the zombies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2009 02:57 PM
тАО08-09-2009 02:57 PM
Re: SIG_IGN does not work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2009 11:59 AM
тАО09-25-2009 11:59 AM
Re: SIG_IGN does not work
We modified the code above (in first thread) as below
struct sigaction sa;
sa.sa_flags = SA_NOCLDWAIT;
if (sigaction(SIGCHLD, &sa, NULL) == -1) {
perror("sigaction");
exit(1);
}
We removed SIG_IGN, since suspected that SIG_IGN is not supported in POSIX standard.
It works if we do not make any system calls.
If any system call is made as
system (command), it executes the system command and on completion returns
Program terminated with signal 11, Segmentation fault.
SEGV_MAPERR - Address not mapped to object
As mentioned in original thread, we don't want the parent process to wait on child and do not want to use waitpid or wait().
We want parent to start the child processes and from then on child is on its own. parent should not care about the exit/termination of the child. and child should exit on it own and if not init will reap it. How to make this work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2009 10:37 PM
тАО09-25-2009 10:37 PM
Re: SIG_IGN does not work
>Program terminated with signal 11
Right, system(3) fiddles with SIGCHLD and wait.
What does stack trace show for your signal 11?
>We want parent to start the child processes and from then on child is on its own. How to make this work?
You probably need to have each child daemonize themselves.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2009 09:10 AM
тАО09-28-2009 09:10 AM
Re: SIG_IGN does not work
$ gdb ServiceFactory_Service core
HP gdb 5.4.0 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 5.4.0 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
Core was generated by `ServiceFactory'.
warning: ServiceFactory is 14 characters in length. Due to a limitation
in the HP-UX kernel, core files contain only the first 14 characters
of an executable's name. Check if ServiceFactory is a truncated name.
If it is so, core-file, packcore and other commands dealing with
core files will exhibit incorrect behavior. To avoid this, issue
exec-file and symbol-file commands with the full name of the executable
that produced the core; then issue the core-file, packcore or other
core file command of interest.
Program terminated with signal 11, Segmentation fault.
SEGV_MAPERR - Address not mapped to object
warning: Load module /u01/app/oracle10g/product/10.2.0/lib/libclntsh.so.10.1 has been stripped.
Debugging information is not available.
warning: Load module /u01/app/oracle10g/product/10.2.0/lib/libnnz10.so has been stripped.
Debugging information is not available.
#0 0xffffffff80000000 in
(gdb) where
#0 0xffffffff80000000 in
warning: Attempting to unwind past bad PC 0xffffffff80000000
#1 0xe000000120002620 in
#2 0xc0000000003267f0:0 in sigprocmask+0x30 () from /usr/lib/hpux64/libc.so.1
#3 0xc000000000319d20:0 in _system_sys+0x330 () from /usr/lib/hpux64/libc.so.1
#4 0xc000000000339ea0:0 in system+0xa0 () from /usr/lib/hpux64/libc.so.1
#5 0x4000000000259710:0 in main () at src/main.cpp:145
(2) How to daemonize the child?
What would be the effect of this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2009 12:54 PM
тАО09-28-2009 12:54 PM
Re: SIG_IGN does not work
#2 0xc0000000003267f0:0 in sigprocmask+0x30 libc.so.1
#3 0xc000000000319d20:0 in _system_sys+0x330 libc.so.1
#4 0xc000000000339ea0:0 in system+0xa0 libc.so.1
It looks like the signal 11 has been blocked and only occurs when sigprocmask unblocks it in the kernel, frame #1.
You would need to subvert all calls to sigprocmask to never block signal 11 if you want to see where it is occurring.
Do you have other threads?
>(2) How to daemonize the child?
Just google daemonize.
>What would be the effect of this?
Its parent will already be init(1m). It will be in a different process group.
Of course you must wait for that intermediate child process, or use SIG_IGN.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2009 11:26 AM
тАО09-29-2009 11:26 AM
Re: SIG_IGN does not work
> (2) How to daemonize the child?
There is a nice, short and simple example:
http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=ea08852bcbe02110852bcbe02110275d6e10RCRD
Kind regards,
Kobylka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2009 01:44 AM
тАО10-09-2009 01:44 AM
Re: SIG_IGN does not work
2. how to subvert the calls to sigprocmask?
3. Yes we have one thread in parent process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2009 12:09 AM
тАО10-10-2009 12:09 AM
Re: SIG_IGN does not work
Just hunt down the demon and kill it?
Of course if you can do this, you can also hunt down your zombies and kill them too. :-)
Back to your original problem. You could call waitpid with WNOHANG to do a poll of your child processes every hour or so.
>2. how to subvert the calls to sigprocmask?
Set a breakpoint there and analyze the mask and then change it to not block signal 11.
Or write function called sigprocmask, analyze and change the parms and then call _sigprocmask to do the work.
>3. Yes we have one thread in parent process.
You have created one additional thread?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2009 10:54 PM
тАО12-15-2009 10:54 PM
Re: SIG_IGN does not work
2.I read on article, in that they mentioned that sigprocmask() will have undesired results in multithreaded application. So i think we can't use sigprocmask() in our application.
Is there any other way to resolve this problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2009 03:58 AM
тАО12-16-2009 03:58 AM
Re: SIG_IGN does not work
So you are multithreaded.
>2. in that they mentioned that sigprocmask will have undesired results in multithreaded application. So I think we can't use sigprocmask in our application.
The purpose of fiddling with sigprocmask(2) is to prevent the blocking of signal 11 so you can debug.
After 4 months and no points, it's probably time to contact the Response Center.