Bug 638979

Summary: `set follow-fork-mode child' fails on sshd (PIE?)
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan.kratochvil>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: jan.kratochvil, pmuldoon, tbzatek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: gdb-7.2-23.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-28 06:07:32 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:
Attachments:
Description Flags
screenshot none

Description Jan Kratochvil 2010-09-30 14:31:02 UTC
Description of problem:


Version-Release number of selected component (if applicable):
gdb-7.2-6.fc14.x86_64
openssh-server-5.6p1-9.fc15.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. gdb /usr/sbin/sshd `pgrep sshd`
2. set follow-fork-mode child
3. c
4. ssh localhost
5. http://fpaste.org/Bzex/raw/
6. sshd[4441]: segfault at  ...

Actual results:
(gdb) set follow-fork-mode child
(gdb) c
Continuing.
[New process 2094]
[Thread debugging using libthread_db enabled]
process 2094 is executing new program: /usr/sbin/sshd
[Thread debugging using libthread_db enabled]
[New process 2095]
[Thread debugging using libthread_db enabled]

Program exited normally.
(gdb) q

Expected results:
debugged child

Additional info:
There may be some PIE problem, sshd is ET_DYN and:
(gdb) c
Continuing.
process 2443 is executing new program: /usr/sbin/sshd
Error in re-setting breakpoint 1: Cannot access memory at address 0xc2d0
Error in re-setting breakpoint 2: Cannot access memory at address 0xd5c0
Error in re-setting breakpoint 1: Cannot access memory at address 0xc2d0
Error in re-setting breakpoint 2: Cannot access memory at address 0xd5c0

Comment 1 Jan Kratochvil 2010-09-30 14:38:56 UTC
Created attachment 450773 [details]
screenshot

Comment 2 Jan Kratochvil 2010-09-30 18:54:22 UTC
post:
[patch] Fix inferior execl of new PIE x86_64
http://sourceware.org/ml/gdb-patches/2010-09/msg00519.html

You need to use set follow-fork-mode child first and then parent on the second fork, otherwise the control also gets lost, though.

Comment 3 Fedora Update System 2010-10-13 02:55:31 UTC
gdb-7.2-22.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/gdb-7.2-22.fc14

Comment 4 Fedora Update System 2010-10-13 06:10:39 UTC
gdb-7.2-22.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update gdb'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/gdb-7.2-22.fc14

Comment 5 Fedora Update System 2010-10-14 15:42:53 UTC
gdb-7.2-23.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/gdb-7.2-23.fc14

Comment 6 Fedora Update System 2010-10-28 06:07:10 UTC
gdb-7.2-23.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.