From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1691 invoked by alias); 6 Sep 2013 09:21:00 -0000 Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org Received: (qmail 1676 invoked by uid 89); 6 Sep 2013 09:20:59 -0000 Received: from mms2.broadcom.com (HELO mms2.broadcom.com) (216.31.210.18) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Sep 2013 09:20:59 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RDNS_NONE autolearn=no version=3.3.2 X-HELO: mms2.broadcom.com Received: from [10.9.208.57] by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Fri, 06 Sep 2013 02:14:29 -0700 X-Server-Uuid: 4500596E-606A-40F9-852D-14843D8201B2 Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.438.0; Fri, 6 Sep 2013 02:19:44 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.1.438.0; Fri, 6 Sep 2013 02:19:44 -0700 Received: from [10.177.73.74] (unknown [10.177.73.74]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 4E6601A46; Fri, 6 Sep 2013 02:19:44 -0700 (PDT) Message-ID: <52299E2F.3030304@broadcom.com> Date: Fri, 06 Sep 2013 09:21:00 -0000 From: "Andrew Burgess" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: "Keith Seitz" cc: insight@sourceware.org Subject: Re: [PATCH 2/2] Notice architecture changes even when the register window is not open. References: <5228941F.8080601@broadcom.com> <522894D1.3030209@broadcom.com> <5228D4B7.2020908@redhat.com> In-Reply-To: <5228D4B7.2020908@redhat.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-q3/txt/msg00039.txt.bz2 On 05/09/2013 8:00 PM, Keith Seitz wrote: > On 09/05/2013 07:27 AM, Andrew Burgess wrote: >> I think this a bad situation to be in as, the reg-cache would ideally >> be hidden from the user of "gdb_reginfo", and secondly, we only >> really need to update the reg-cache once per architecture change, not >> many times, which could happen if many users are all trying to keep >> the reg-cache upto date. > > Ouch. I believe at the time, this was never considered. I'm not even > sure if it was possible. Nonetheless, it clearly *is* possible now, so > thank you for tracking this down. > > BTW, what architecture are you using to trigger this bug? "Just" x86-64. Once the assert in my previous patch is added it's easy to see a failure. I configure gdb with "--enable-libmcheck --enable-targets=all". $ uname -a Linux HOSTNAME 2.6.18-274.17.1.el5 #1 SMP Wed Jan 4 22:45:44 EST 2012 x86_64 x86_64 x86_64 GNU/Linux $ cat hello.c #include int main () { printf ("Hello World\n"); return 0; } $ gcc --version gcc (GCC) 4.7.2 $ gcc -g -o hello.x86 hello.c $ gdb -i insight # Then ... # File > Open > # Run Button (Stops at start of main) # Registers Button (Assert Fires) With the assertion removed, the original SEGV I saw was triggered by: once the register window had opened up I modified the contents of the rsp register to "0x0", hit return, then closed the register window. Next I clicked the "Next" button (I wanted to see insight handle a SEGV in the target application), I see a warning that the target has received a SIGSEGV, click OK, and then insight crashes, also with a SEGV. Phew! Obviously there's going to be some randomness depending on memory layout by the compiler, so it's you might not see the exact behaviour I saw... HTH Andrew