From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18866 invoked by alias); 13 Jun 2011 17:45:18 -0000 Received: (qmail 18858 invoked by uid 22791); 13 Jun 2011 17:45:17 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Jun 2011 17:45:01 +0000 Received: from wpaz1.hot.corp.google.com (wpaz1.hot.corp.google.com [172.24.198.65]) by smtp-out.google.com with ESMTP id p5DHiwQO000592 for ; Mon, 13 Jun 2011 10:44:59 -0700 Received: from yic15 (yic15.prod.google.com [10.243.65.143]) by wpaz1.hot.corp.google.com with ESMTP id p5DHivV9028623 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 13 Jun 2011 10:44:57 -0700 Received: by yic15 with SMTP id 15so2752294yic.26 for ; Mon, 13 Jun 2011 10:44:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.9.20 with SMTP id m20mr5286615ani.46.1307987097263; Mon, 13 Jun 2011 10:44:57 -0700 (PDT) Received: by 10.100.93.20 with HTTP; Mon, 13 Jun 2011 10:44:57 -0700 (PDT) In-Reply-To: <20110612121158.GA10611@host1.jankratochvil.net> References: <20110612121158.GA10611@host1.jankratochvil.net> Date: Mon, 13 Jun 2011 17:45:00 -0000 Message-ID: Subject: Re: [PATCH] Make interrupting tab-completion safe. From: Sterling Augustine To: Jan Kratochvil Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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: 2011-06/txt/msg00172.txt.bz2 On Sun, Jun 12, 2011 at 5:11 AM, Jan Kratochvil wrote: > On Sat, 11 Jun 2011 02:19:05 +0200, Sterling Augustine wrote: >> gdb >> b >> [ctrl-c before tab-completion is done] >> b >> (segmentation fault) > > I do not have it reproducuble, does not happen for you for ./gdb -nx ./gd= b? > Tried also Firefox, both processing runs long enough to CTRL-C it. gdb itself isn't big enough to make it easy to reproduce (~24k symbols). The smallest programs I see this on are about 5x that size and don't use shared libraries. (Not sure about mozilla, or the interaction between shared libraries and this.) Certainly, the bigger the binary, the easier it is to reproduce. If you haven't noticed that tab-completion (immediately on launch with no init script) is unusably slow, then the binary probably isn't big enough to trip this bug easily. The race is between the conversion from psymtab to full symtab and you hitting ctrl-c. Some of this time is also spent handling filename completion, which doesn't have the problem. You need to be sure to interrupt c_type_print_args, when called from dwarf2read.c:5049. > It would be good to have a testcase for regressions anyway. Is there an existing test-case I can model this one on? (One that sends an asynchronous sigint to gdb is probably enough.) I can't seem to find any, but my deja-gnu foo is weak. >> The problem comes because the dwarf2read.c tries to discover the full >> linkage name of symbols, and assumes that it won't be interrupted. > > I had rather an idea to make it interruption-safe as this way another > forgotten or newly introduced QUIT may regression it. =A0But I do not have > a reproducer to check where the crash happens.