Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to prevent gdb to send Interrupt signals to child processes Post 302279223 by klnarayana on Thursday 22nd of January 2009 06:28:45 AM
Old 01-22-2009
How to prevent gdb to send Interrupt signals to child processes

Hi,

I have a program which invokes child processes and communicates with the processes. When I run the program under gdb and say interrupt, all the child processes are dying. Here I am not interested in debugging the child processes. But I don't want my child processes to be killed as my parent process dies as soon as the child process is killed. Also I have no access to the child process code for any modifications. My assumption is that gdb sends interrupt signals to child processes because of which they are dying (but I am not sure about this).

I have tried "handle sigint nopass" on gdb. But it did not work for me.Please let me know if there is any way to prevent gdb to send interrupt signals to child processes.

Thanks in advance,
klnarayana
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

what are parent and child processes all about?

I don't follow what these are... this is what my text says... "When a process is started, a duplicate of that process is created. This new process is called the child and the process that created it is called the parent. The child process then replaces the copy for the code the parent... (1 Reply)
Discussion started by: xyyz
1 Replies

2. Programming

Controlling child processes

Hello all, I am trying to create n child processes and control them from a parent process; say make child 3 print its pid and then child 5 do the same and some other stuff. Is there a way to accomplishing this after all the child processes are created via a call to fork(). Thank you, FG (23 Replies)
Discussion started by: forumGuy
23 Replies

3. UNIX for Advanced & Expert Users

gdb to child process

Hi, I want to debug a child process which is forked from other process. Whenever I try to attach the pid of child process to gbd, the process gets killed and the parent process starts a new child process. any idea what could be the reason. In general how can i debug a child process... (4 Replies)
Discussion started by: shriashishpatil
4 Replies

4. Shell Programming and Scripting

Parent/Child Processes

Hello. I have a global function name func1() that I am sourcing in from script A. I call the function from script B. Is there a way to find out which script called func1() dynamically so that the func1() can report it in the event there are errors? Thanks (2 Replies)
Discussion started by: yoi2hot4ya
2 Replies

5. Programming

fork() and child processes

Hello, How many child processes are actually created when running this code ? #include <signal.h> #include <stdio.h> int main () { int i ; setpgrp () ; for (i = 0; i < 10; i++) { if (fork () == 0) { if ( i & 1 ) setpgrp () ; printf ("Child id: %2d, group: %2d\n", getpid(),... (0 Replies)
Discussion started by: green_dot
0 Replies

6. Shell Programming and Scripting

fork() and child processes

Hello, How many child processes are actually created when running this code ? #include <signal.h> #include <stdio.h> int main () { int i ; setpgrp () ; for (i = 0; i < 10; i++) { if (fork () == 0) { if ( i & 1 ) setpgrp () ; printf ("Child id: %2d, group: %2d\n",... (1 Reply)
Discussion started by: green_dot
1 Replies

7. UNIX for Advanced & Expert Users

killing all child processes

Hi, Is there a way I can kill all the child processes of a process, given its process id. Many thanks in advance. J. (1 Reply)
Discussion started by: superuser84
1 Replies

8. Programming

How to block or ignore signals from certain processes?

We know that a process can block certain signals by call sigprocmask(), but sometimes we may want to block signals from certain processes for safety concerning. For example, a system may have a process management daemon, and it will response to certain signals from certain processes managed by... (4 Replies)
Discussion started by: aaronwong
4 Replies

9. Programming

sending signals between two processes

Hello, I have two programs: server.c and client.c I need to send signal from client to server. As far as I know I need to use kill() function. To use kill() function I have to know the pid the second process. How can I send pid from process to process(both are written in separate files). ... (3 Replies)
Discussion started by: fasolens
3 Replies

10. Shell Programming and Scripting

Get all child processes of a process

is there a universal way of getting the children of a particular process? i'm looking for a solution that works across different OSes...linux, aix, sunos, hpux. i did a search online and i kept finding answers that were specific to Linux..i.e. pstree. i want to be able to specify a process... (2 Replies)
Discussion started by: SkySmart
2 Replies
system(3S)																system(3S)

NAME
system() - issue a shell command SYNOPSIS
DESCRIPTION
executes the command specified by the string pointed to by command. The environment of the executed command is as if a child process were created using (see fork(2)), and the child process invoked the sh-posix(1) utility via a call to (see exec(2)) as follows: ignores the and signals, and blocks the signal, while waiting for the command to terminate. If this might cause the application to miss a signal that would have killed it, the application should examine the return value from and take whatever action is appropriate to the application if the command terminated due to receipt of a signal. does not affect the termination status of any child of the calling processes other than the process or processes it itself creates. does not return until the child process has terminated. APPLICATION USAGE
If the return value of is not -1, its value can be decoded through the use of the macros described in For convenience, these macros are also provided in Note that, while must ignore and and block while waiting for the child to terminate, the handling of signals in the executed command is as specified by fork(2) and exec(2). For example, if is being caught or is set to when is called, the child is started with handling set to Ignoring and in the parent process prevents coordination problems (such as two processes reading from the same terminal) when the executed command ignores or catches one of the signals. RETURN VALUE
If command is null, returns non-zero. If command is not null, returns the termination status of the command language interpreter in the format specified by wait(2). The termi- nation status of the command language interpreter is as specified for sh-posix(1), except that if some error prevents the command language interpreter from executing after the child process is created, the return value from is as if the command language interpreter had termi- nated using If a child process cannot be created, or if the termination status for the command language interpreter cannot be obtained, returns -1 and sets to indicate the error. DIAGNOSTICS
forks to create a child process which, in turn, in order to execute string. If the fork fails, returns -1 and sets If the exec fails, returns the status value returned by (see wait(2)) for a process that terminates with a call of ERRORS
If errors are encountered, sets values as described by fork(2). FILES
SEE ALSO
sh(1), fork(2), exec(2), wait(2), thread_safety(5). STANDARDS CONFORMANCE
system(3S)
All times are GMT -4. The time now is 01:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy