Bug 1318049

Summary: 7.11 regression: non-stop gdb -p <process from a container>: internal error
Product: Red Hat Developer Toolset Reporter: Jan Kratochvil <jan.kratochvil>
Component: gdbAssignee: Pedro Alves <palves>
Status: CLOSED ERRATA QA Contact: Martin Cermak <mcermak>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: DTS 4.1 RHEL 7CC: jan.kratochvil, mcermak, ohudlick, palves
Target Milestone: beta1Keywords: Regression
Target Release: 4.1   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: devtoolset-4-gdb-7.11-65.el7,devtoolset-4-gdb-7.11-65.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-31 08:40:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
threadit.c none

Description Jan Kratochvil 2016-03-15 21:09:51 UTC
Created attachment 1136764 [details]
threadit.c

Description of problem:
Attaching to a multithreaded process PID which is running inside a container will crash GDB.  It is not correct to attach to a containerized PID this way - one should use gdbserver instead due to a missing GDB feature.  Still it can happen by an accident and GDB should not crash.

Version-Release number of selected component (if applicable):
devtoolset-4-gdb-7.11-57.el7.x86_64

How reproducible:
Always.

Steps to Reproduce:
# docker run -ti -v /root:/root docker.io/centos bash
Inside docker:
# /root/threadit
Outside docker:
# gdb -p `pidof threadit`
(gdb) q

Actual results:
A debugging session is active.
	Inferior 1 [process 7483] will be detached.
Quit anyway? (y or n) y
thread.c:980: internal-error: is_executing: Assertion `tp' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) _

Expected results:
A debugging session is active.
        Inferior 1 [process 7483] will be detached.
Quit anyway? (y or n) y
Detaching from program: target:/root/redhat/threadit, process 7483

Additional info:
Bug #1: The internal error should not happen.
Bug #2: One cannot entry anything ('y' or 'n'), GDB does not respond.
It is not reproducible with non-threaded process.
Attaching a sample multi-threaded process I used for reproducibility.  I guess any multithreaded process would suffice.

Comment 6 errata-xmlrpc 2016-05-31 08:40:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1144