From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11082 invoked by alias); 15 Apr 2014 09:11:28 -0000 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 Received: (qmail 11057 invoked by uid 89); 15 Apr 2014 09:11:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-gw3-out.broadcom.com Received: from mail-gw3-out.broadcom.com (HELO mail-gw3-out.broadcom.com) (216.31.210.64) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 15 Apr 2014 09:11:26 +0000 Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw3-out.broadcom.com with ESMTP; 15 Apr 2014 02:29:28 -0700 Received: from IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.3.174.1; Tue, 15 Apr 2014 02:11:24 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) with Microsoft SMTP Server id 14.3.174.1; Tue, 15 Apr 2014 02:11:24 -0700 Received: from [10.177.73.63] (unknown [10.177.73.63]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 66A05EAD85 for ; Tue, 15 Apr 2014 02:11:22 -0700 (PDT) Message-ID: <534CF7B9.6070709@broadcom.com> Date: Tue, 15 Apr 2014 09:11:00 -0000 From: Andrew Burgess User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Subject: Re: [RFC 0/4] Catch errors in get_prev_frame. References: <533EC5B7.6080600@broadcom.com> In-Reply-To: <533EC5B7.6080600@broadcom.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00288.txt.bz2 Ping. On 04/04/2014 3:46 PM, Andrew Burgess wrote: > While working on a reproducer for this patch: > https://sourceware.org/ml/gdb-patches/2014-03/msg00629.html > > I ran into a few other issues. The route cause of the problems I'm > seeing is that not all errors thrown within get_prev_frame are caught. > This causes a couple of problems, > > 1. For the MI this means that commands like -stack-info-depth will > return an error rather than a result. Even more annoying, is that > depending on where in the process the error is thrown enough state may > be left set that the /next/ time -stack-info-depth is asked, the correct > result is given! > > 2. For standard CLI backtraces our the results are (I think) > inconsistent, so for example some backtraces will end with a message > like: "Backtrace stopped: previous frame inner to this frame (corrupted > stack?)", this message will be displayed every time the backtrace is > requested, in other cases though, the reason is only displayed the first > time a backtrace is requested, this is the case when an uncaught error > causes the backtrace to stop, also in the uncaught error case the > "Backtrace stopped" prefix does not appear. > > This patch set tries to fix both these issues by holding a frame > specific string that describes why the backtrace stopped at this frame > (only for the last frame in the backtrace obviously). If this string is > not set then we still use the existing generic strings. > > A new TRY_CATCH inside get_prev_frame catches (currently) all unhandled > errors, the error message from these errors is then used as a frame > specific stop reason string. There's a new unwind_stop_reason code for > this case, UNWIND_MISC_ERROR. > > If it's felt that catching all errors like this is too much then I could > soften this to just catching MEMORY_ERRORs, as right now the problems > I'm seeing all relate to accessing memory through a corrupted stack pointer. > > Here's what each patch does: > > #1 - This patch just adds some tests, some of the tests fail, and are > fixed by later patches in this series. > > #2 - An error in the wrong place leaves a frame partially initialised, > this can then cause internal errors / assertions to fire. Add a clean > up to fix this issue. > > #3 Deprecate frame_stop_reason_string, rename all use sites. I'm going > to add a new version in the next patch that takes a struct frame_info > pointer. > > #4 Add the new TRY_CATCH and the new stop reason string into the > frame_info structure. > > Thanks, > Andrew > >