From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47687 invoked by alias); 18 Oct 2017 09:17:36 -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 47425 invoked by uid 89); 18 Oct 2017 09:17:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*r:sk:gdb@sou, stephen, roberts, Roberts X-HELO: mail-wm0-f54.google.com Received: from mail-wm0-f54.google.com (HELO mail-wm0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Oct 2017 09:17:34 +0000 Received: by mail-wm0-f54.google.com with SMTP id k4so8855238wmc.1 for ; Wed, 18 Oct 2017 02:17:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=8lW/tkb3vWn8FKzUZTY192UCofY7DLMN0/EPhUp++fE=; b=G2+N9u/QJxR9AcjPu2TIpX5jwExO+e4uw4kE+782L8WpfFIsGkAS7e+4kj04mTZ3YO P/wwsliZ++FDhaYn5JC3JSHGTpGOtFOrf6iQBDQMJ+rlOMmLBHM6x6xXwpmXspFS06lt BiPeAu/zrIEXL9suRvACmKNCnQehEMszGd2uCckAkaKcQDFpQYHP9poSpWIjt0yYvcyA tDGZy/dyxVvLrVAMp/s+uCgp2MUk2E3ZnhdXOD65sbJqKyhY+taKKOj85pV5RaYLaVRn Eoy4+ViJHcjesGRSaqqqMOt6QuiFnN2zGOoBisaRl+Wa9madzsSy5AZ6diwbNSG1sNaT 5MHw== X-Gm-Message-State: AMCzsaWUzCo9P0TeLC0xnr2IQUf0/3oqhxQHzqAd0aSUFofVPMh5eNyC vpIp4Ywnu5x96/bLbvxEgY8= X-Google-Smtp-Source: ABhQp+SeLPlQD7SLFSjQU9ZzIsjHafbvtpEflp4Kdxn93TcXHE+2sawsNaILnDSBYb2BDmupA2+miA== X-Received: by 10.28.62.145 with SMTP id l139mr6044548wma.150.1508318252382; Wed, 18 Oct 2017 02:17:32 -0700 (PDT) Received: from E107787-LIN (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id k126sm5848969wmd.1.2017.10.18.02.17.31 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 02:17:31 -0700 (PDT) From: Yao Qi To: Stephen Roberts Cc: Pedro Alves , "gdb\@sourceware.org" , nd Subject: Re: GDB hangs when calling inferior functions References: <3b857cc7-e722-f10f-7fea-c3928cc0ac36@redhat.com> Date: Wed, 18 Oct 2017 09:17:00 -0000 In-Reply-To: (Stephen Roberts's message of "Thu, 12 Oct 2017 13:33:13 +0000") Message-ID: <86tvywvmqg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00049.txt.bz2 Stephen Roberts writes: > I've included a gdb testcase below - hopefully this format is acceptable.= This testcase reproduces the issue around 99% of the time on my ubuntu 16.= 04 machine. This figure drops closer to 50% when under heavy load, which su= ggested a race condition. I dug deeper into this and found that the threads= which hang are always ones which did not hit the breakpoint but were stop= ped when another thread did hit a breakpoint. Threads which are stopped at = breakpoints are immune to this issue. Loading the system allows more thread= s to reach the breakpoint before they are stopped by gdb.=20 I can reproduce the hang with your test case. Looks inferior_event_handler (INF_EXEC_COMPLETE, ) should be called somewhere, may be in infrun or the thread finite-state machine is in a wrong state for inferior call. --=20 Yao (=E9=BD=90=E5=B0=A7)