From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12680 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: GDB to debug threaded application Date: Fri, 6 Apr 2018 17:22:45 -0400 Message-ID: <20180406212245.GB3094@brightrain.aerifal.cx> References: <20180406172210.GA3094@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1523049656 20258 195.159.176.226 (6 Apr 2018 21:20:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 6 Apr 2018 21:20:56 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-12694-gllmg-musl=m.gmane.org@lists.openwall.com Fri Apr 06 23:20:52 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1f4Ymy-0005AV-5A for gllmg-musl@m.gmane.org; Fri, 06 Apr 2018 23:20:52 +0200 Original-Received: (qmail 30370 invoked by uid 550); 6 Apr 2018 21:22:58 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 30311 invoked from network); 6 Apr 2018 21:22:57 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12680 Archived-At: On Fri, Apr 06, 2018 at 11:00:48PM +0200, Micha Nelissen wrote: > On 6 Apr 2018, at 19:22, Rich Felker wrote: > > > >> On Fri, Apr 06, 2018 at 06:33:35PM +0200, Micha Nelissen wrote: > >> Hi all, > >> > >> I have built a cross-toolchain (x86-64 to arm, gcc 5.4.0) with musl > >> (1.1.16) using buildroot (2017.02). I let buildroot build a gdb for > >> the arm platform. It runs, but when I debug my application, gdb > >> hangs after a thread is started. Can't interrupt it, have to kill > >> -KILL my application from another ssh session. > >> > >> I noticed that there is a libthread_db.so in the glibc-based > >> toolchain. Do I need something similar for musl? That > >> libthread_db.so needs libc.so.6 (glibc) so I guess I can't use it > >> as-is? > >> > >> Thanks for any pointers! > > > > No, musl does not use libthread_db.so, but presence of a glibc version > > of this library could break things badly. Make sure it's not being > > built or present in any location gdb might search. Are you using a > > remote/cross gdb (with gdbserver on the target) or local gdb? > > A local gdb. In the buildroot environment, no libthread_db is present I think. Can you reproduce this behavior (the hang) with a trivial test program that starts a thread, or does it only happen with your real application? Rich