Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 235197

Summary: FEAT: Always display: Detaching after fork from child process ...
Product: Red Hat Enterprise Linux 5 Reporter: Jan Kratochvil <jan.kratochvil>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: cagney, gnichols, ptesarik
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0332 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 16:55:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 234468    
Bug Blocks:    
Attachments:
Description Flags
Trivial testcase. none

Description Jan Kratochvil 2007-04-04 13:46:28 UTC
Description of problem:
Currently any fork(2)ed child processes get out of GDB tracking which may be
unexpected by the GDB user.
It has been proven on Bug 234468.

Version-Release number of selected component (if applicable):
gdb-6.5-16.el5.ia64
+RawHide
+upstream

How reproducible:
Always.

Steps to Reproduce:
1. gcc -o dinner dinner.c -Wall -ggdb3
2. gdb ./dinner
3. (gdb) break knife
4. (gdb) run

Actual results:
Starting program: /root/jkratoch/redhat/dinner 
knife
Program exited normally.

Expected results:
As one originally expects as after `set follow-fork-mode child':
Breakpoint 1, knife () at dinner.c:11
11        puts ("knife");
(gdb) 

It would be helpful to get at least:
Starting program: /root/jkratoch/redhat/dinner
Detaching after fork from child process 11836.
knife
Program exited normally.

Additional info:
Patch is a trivial oneliner.
Slightly different GDB output may be considered a Regression.

Comment 1 Jan Kratochvil 2007-04-04 13:46:28 UTC
Created attachment 151656 [details]
Trivial testcase.

Comment 2 Jan Kratochvil 2007-04-22 20:30:59 UTC
Committed to RawHide incl. the testcase `gdb.base/fork-detach.exp':
* Sun Apr 22 2007 Jan Kratochvil <jan.kratochvil> - 6.6-10
- Notify user of a child forked process being detached (BZ 235197).


Comment 7 Jan Kratochvil 2007-12-05 19:30:58 UTC
Posted upstream:
  http://sources.redhat.com/ml/gdb-patches/2007-12/msg00087.html


Comment 13 errata-xmlrpc 2008-05-21 16:55:01 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0332.html


Comment 15 Petr Tesařík 2018-04-27 16:34:33 UTC
(In reply to Jan Kratochvil from comment #7)
> Posted upstream:
>   http://sources.redhat.com/ml/gdb-patches/2007-12/msg00087.html

The above patch is apparently superseded by this one:

https://sourceware.org/ml/gdb-patches/2018-04/msg00392.html