From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11556 invoked by alias); 2 Feb 2020 21:47:20 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 11543 invoked by uid 89); 2 Feb 2020 21:47:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.6 required=5.0 tests=AWL,BAYES_00,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=suspect, HX-Languages-Length:1541 X-HELO: mail-wm1-f68.google.com Received: from mail-wm1-f68.google.com (HELO mail-wm1-f68.google.com) (209.85.128.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 02 Feb 2020 21:47:19 +0000 Received: by mail-wm1-f68.google.com with SMTP id b17so14813024wmb.0 for ; Sun, 02 Feb 2020 13:47:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YmNYc8ZTEf/tGH+n1/Q2fKdKkd/HpvAsvNxC2DHhDqo=; b=hrYPK+IoXWtgplyFEn6UdYPennMIXaU+R8X6E/6d2ecnZRaFJHtV1KPtADCHuvXmio GiJ6gp51otqvZ8QLGa7y3OnvHDYCoENWZ4WZIZdd7RDe+66GdF7cL3FwNeaf3Zt2uuEf 7nP4fQGk9Mm6xMc57YMW3GKyZ+gOwC/FJ1Dql+yj5kRzc7EtUvOkLOyVeU8iEd+agWLT raKqolTj3xxzJqGborHmLZemfyqsTcqUtFwePeZUo68K+CCprms+U7pQ5m3TcQppLeFT DH2ltz7DYicl+TPHRtlo1lCmAVsvKwZC7bc29c4v2w54OX8C9cLpQUp+PBQrLJdsAahP TkmQ== Return-Path: Received: from localhost (host86-191-239-73.range86-191.btcentralplus.com. [86.191.239.73]) by smtp.gmail.com with ESMTPSA id l8sm4759830wmj.2.2020.02.02.13.47.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Feb 2020 13:47:16 -0800 (PST) Date: Sun, 02 Feb 2020 21:47:00 -0000 From: Andrew Burgess To: William Tambe Cc: gdb@sourceware.org Subject: Re: sim_engine_halt() broken in binutils 2.34 Message-ID: <20200202214715.GA20838@embecosm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Fortune: It looks like blind screaming hedonism won out. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00003.txt.bz2 * William Tambe [2020-02-02 00:03:40 -0500]: > I am running GDB with target sim. > > Calling sim_engine_halt() triggers the following error: > ../../binutils-gdb/gdb/inferior.c:286: internal-error: inferior* > find_inferior_pid(process_stratum_target*, int): Assertion `pid != 0' > failed. > A problem internal to GDB has been detected, > further debugging may prove unreliable. > Quit this debugging session? (y or n) > > Any idea idea what changed ? I suspect that this is a similar issue (but not the exact same fix) as something I already posted here: https://sourceware.org/ml/gdb-patches/2020-01/msg00980.html You could double check if you like, I believe if you check out the commit just before 5b6d1e4fa4fc682 then you'll find your issue goes away. The problem is caused, I suspect, by a use of `inferior_ptid' at a place where this used to not be the null_ptid, but now is null_ptid. I had a little nose around for places related to the simulator where this bug might be hiding, but couldn't see anything obvious. If you could let us know which simulator you're using, and what you do to trigger the call to sim_engine_halt then we might be able to reproduce the issue. You could also try to collect a backtrace from GDB at the point the assertion triggers, I believe GDB offers to dump core on an assertion, so you can use that to obtain the backtrace. We might get lucky, and something in the backtrace could be the offender. Best of luck! Andrew