From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27436 invoked by alias); 16 Mar 2012 14:46:23 -0000 Received: (qmail 27426 invoked by uid 22791); 16 Mar 2012 14:46:22 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Mar 2012 14:46:03 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2GEk28f005610 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Mar 2012 10:46:02 -0400 Received: from host2.jankratochvil.net (ovpn-116-16.ams2.redhat.com [10.36.116.16]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2GEjwu8004605 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 16 Mar 2012 10:46:01 -0400 Date: Fri, 16 Mar 2012 14:46:00 -0000 From: Jan Kratochvil To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: [patch] Stop runaway unwinding on stripped executables Message-ID: <20120316144557.GA22309@host2.jankratochvil.net> References: <20120316120207.GA10006@host2.jankratochvil.net> <201203161350.q2GDouZL019372@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203161350.q2GDouZL019372@glazunov.sibelius.xs4all.nl> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-03/txt/msg00610.txt.bz2 On Fri, 16 Mar 2012 14:50:56 +0100, Mark Kettenis wrote: > People need to learn that if they are debugging stripped stuff they're > going to end up with runaway backtraces every now and then. There is no need to teach that them. > In this particular example you're just getting lucky that you're hitting > __libc_start_main(). In other cases they end up in 'start_thread' and its caller 'clone' which correctly undefines $pc and stops the unwinding. > That probably wouldn't happen if you're somewhat deeper into the call stack > of the (stripped) program that you're trying to debug. I can only imagine code which does not use -fasynchronous-unwind-tables. But normal distros use it, therefore they can numerically unwind anything as well as with full debug info. Sure the correct solution is to terminate unwinding in '_start' (like it is terminated in 'clone'), thanks for refreshing this idea. Still GDB could have this workaround for older code. > But the implementation and actually the whole idea is *very* > glibc-specific. Yes, I was thinking about it, but glibc is neither arch nor OS specific. Where to put it into GDB better? Thanks, Jan