From patchwork Sat Nov 29 10:16:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Chandra Reddy X-Patchwork-Id: 4005 Received: (qmail 4630 invoked by alias); 29 Nov 2014 10:16:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 4620 invoked by uid 89); 29 Nov 2014 10:16:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-oi0-f45.google.com Received: from mail-oi0-f45.google.com (HELO mail-oi0-f45.google.com) (209.85.218.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 29 Nov 2014 10:16:10 +0000 Received: by mail-oi0-f45.google.com with SMTP id a141so5535790oig.4 for ; Sat, 29 Nov 2014 02:16:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=gRetwakwKAJh8oqrLa9HGzTjXGr/2fAN6iLZwJagjAc=; b=XGGUZ881ofdARL2OytPJAxUqFOD4GZq5nP7v1vBYho6VuAxH/p2PhLP79gTxZfLwlW VSWeaNhfOH+lgjlSCbHgX874UkT/aMGj8hLCeKZCnNEao45fTzK9C8yVprbnkXqyZnM9 gMueQnIrqZuF55yVtB0tBki6t+y3pwOrHomZAloSqVtr9qbGjaiZrWUsz7gKm+xkQXHm JWHWHYHgdBQelOsUb92NrThsh4EzgMPaq/AkH27QlLeLBcIQndJUF6if94H9ja3d2XWS PRwRkR/CgGarkn/kSQg6+Sfu/D0LWQYbkiERdsoKMIPLvmk9gdxwt/xLv6OUMlwfPbug PFTA== X-Gm-Message-State: ALoCoQlYSQ5rVrrt1tRXSJWBvswjEqMIGgBKInmonuaYk5DmXNWiVkvMStVNajreknxZE/DfM7XY MIME-Version: 1.0 X-Received: by 10.202.55.86 with SMTP id e83mr1704211oia.112.1417256169048; Sat, 29 Nov 2014 02:16:09 -0800 (PST) Received: by 10.202.225.68 with HTTP; Sat, 29 Nov 2014 02:16:08 -0800 (PST) In-Reply-To: <20141129082620.GA16774@host2.jankratochvil.net> References: <201411281210.sASCAQGP013169@d03av02.boulder.ibm.com> <20141129082620.GA16774@host2.jankratochvil.net> Date: Sat, 29 Nov 2014 02:16:08 -0800 Message-ID: Subject: Re: Regression for gdb.cp/exceptprint.exp [Re: [PATCH v6] Make chained function calls in expressions work] From: Siva Chandra To: Jan Kratochvil Cc: Ulrich Weigand , gdb-patches X-IsSubscribed: yes On Sat, Nov 29, 2014 at 12:26 AM, Jan Kratochvil wrote: > On Sat, 29 Nov 2014 01:03:57 +0100, Siva Chandra wrote: >> I have now pushed this patch > > [bash]jkratoch@MOCK-fedora-21-x86_64:/home/jkratoch/redhat/gdb-clean/gdb/testsuite# git log > commit 6c659fc2c7cd2da6d2b9a3d7c38597ad3821832a > Author: Siva Chandra > Date: Tue Nov 11 05:43:03 2014 -0800 > Enable chained function calls in C++ expressions. > > On Fedora 21 x86_64 and x86_64-m32 (i686 not tested due to some unrelated > regression). > > print $_exception^M > -$1 = 0x400b10 "hi bob"^M > -(gdb) PASS: gdb.cp/exceptprint.exp: string: print exception value at throw > -continue^M > +thread.c:711: internal-error: value_in_thread_stack_temporaries: Assertion `tp != NULL && tp->stack_temporaries_enabled' failed.^M > +A problem internal to GDB has been detected,^M > +further debugging may prove unreliable.^M What my patch did was to make evaluate_subexp non re-entrant. As in, if evaluate_subexp is called with *pos == 0 while a top level expression is under evaluation, then it will crash with symptoms similar to the above. While I setup my VM/fedora box, can I ask you to test the attached patch which should fix this (and hopefully fix the regression)? Thanks, Siva Chandra diff --git a/gdb/eval.c b/gdb/eval.c index a13793c..c2ab879 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -69,7 +69,8 @@ evaluate_subexp (struct type *expect_type, struct expression *exp, int cleanup_temps = 0; if (*pos == 0 && target_has_execution - && exp->language_defn->la_language == language_cplus) + && exp->language_defn->la_language == language_cplus + && !thread_stack_temporaries_enabled_p (inferior_ptid)) { cleanups = enable_thread_stack_temporaries (inferior_ptid); cleanup_temps = 1;