From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87846 invoked by alias); 5 May 2015 14:50:22 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 87791 invoked by uid 48); 5 May 2015 14:50:22 -0000 From: "raghu.prabhu13 at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/18368] gdb with nsenter attaches to wrong process Date: Tue, 05 May 2015 14:50:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 7.9 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: raghu.prabhu13 at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q2/txt/msg00222.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18368 --- Comment #2 from Raghavendra --- >Also, I can't imagine how using the docker daemon as a reference can work. As >I understand it the docker daemon does not switch namespaces, so "nsenter -t >$DOCKERPID" should just stay in whatever namespaces you were already in You are right. The namespace remains same for daemon as is the docker client. >You're using nsenter to enter the PID namespace but you're not entering the >corresponding mount namespace; GDB is looking in the wrong /proc. Try adding >"-m" to your nsenter options. I did try - nsenter-t 25057 -p -m gdb -p 1 - but this fails since gdb is not present there. (where 25057 is the pid of process inside container - in this case sleep 100000) >If you're building from source, try this branch: > git clone -b namespaces https://github.com/gbenson/binutils-gdb.git I will try this and get back. -- You are receiving this mail because: You are on the CC list for the bug.