From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 97yaN+HZdWDxOAAAWB0awg (envelope-from ) for ; Tue, 13 Apr 2021 13:50:25 -0400 Received: by simark.ca (Postfix, from userid 112) id D6CCC1F104; Tue, 13 Apr 2021 13:50:25 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 14DDD1E01F for ; Tue, 13 Apr 2021 13:50:25 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 35C363857832; Tue, 13 Apr 2021 17:50:24 +0000 (GMT) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by sourceware.org (Postfix) with ESMTPS id 849613857832 for ; Tue, 13 Apr 2021 17:50:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 849613857832 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wm1-f47.google.com with SMTP id o20-20020a05600c4fd4b0290114265518afso9199650wmq.4 for ; Tue, 13 Apr 2021 10:50:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5Co3BkrsqYZrQnzNAvkPCpn9KIlQNZQQd90658hEx+M=; b=Q60vz4C9xYSvAQeds84FfTlmbOlYWF/G1a0FdozxoZELESi8pIVi0Dz2doUVGts3Em kOOgHvnC4nzz3iNA7UtlPQNo1QDDT/xiWRvNvHlXZwuByYOXocZZYP+rX++wfAtdM4q6 Nz1UN1ZAH+BVHKu8wHMn9IGo6x5h4bvdZRNtgLc0w7hwvBIGBysdJA4HLn+Zl6cu1nOm njeFsC3pq61G/CjGpCe06PUPuoK86MUYzzfJy4jLxVP1mI+iKIF1XW9yVUrNpzsa7vMC wogtFSVlXCRQ5H30PNMD+dfFzy48FjvujQmLNJvBGcCi/q9UY2i/pV7FvvQZ8iqS9WyU a9iw== X-Gm-Message-State: AOAM532g9Hh3QBZoPjsasdmySm2aReGYK6OJtcvKnidoyb2U7MsHzJrV JbOpZBrcOA3JxsGJsQiIr8rBX091/qmKSPlM X-Google-Smtp-Source: ABdhPJwHy0He3CQIdXLN2UOUUyYLz8PzajJ6+Q4NUoki7W+BBc1xlX7QdI+O5tA/xtPkSwRoKYhiqw== X-Received: by 2002:a1c:ed0a:: with SMTP id l10mr1111321wmh.151.1618336219865; Tue, 13 Apr 2021 10:50:19 -0700 (PDT) Received: from ?IPv6:2001:8a0:f932:6a00:6b6e:c7b6:c5a7:aac3? ([2001:8a0:f932:6a00:6b6e:c7b6:c5a7:aac3]) by smtp.gmail.com with ESMTPSA id a4sm213898wmm.12.2021.04.13.10.50.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Apr 2021 10:50:18 -0700 (PDT) Subject: Re: [PATCH][gdb/testsuite] Fix gdb.threads/killed-outside.exp with -m32 From: Pedro Alves To: Luis Machado , Tom de Vries , gdb-patches@sourceware.org References: <20210118114422.GA11394@delia> <208b6e38-66f5-0395-62f7-9f122384a3a5@linaro.org> <500c8933-8d03-9cb0-fd4c-7ab1b3a35065@palves.net> <22f86bac-97f8-f4c2-404e-636ca279fb74@linaro.org> Message-ID: <5faa429c-6d19-cb46-73c8-69ed2c016f69@palves.net> Date: Tue, 13 Apr 2021 18:50:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <22f86bac-97f8-f4c2-404e-636ca279fb74@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 13/04/21 16:51, Luis Machado wrote: > On 4/13/21 11:45 AM, Pedro Alves wrote: >> On 13/04/21 14:33, Luis Machado wrote: >>> >>> Forcing scheduler-locking to on made the output consistent for both cases, but I was left wondering if enabling scheduler-locking would cause the bug to not be reproducible anymore. >> >> Yeah, no.  That would just paper over problems.  GDB should cope with threads disappearing beneath it, as they're resumed, stopped, etc.  Forcing scheduler-locking just >> means you're only resuming one thread instead of many, and thus reducing the chances of some GDB issue triggering.  Wouldn't be much different from making the testcase >> be single-threaded. > > Right. The non-deterministic nature of the output makes it harder to find a reliable pattern to match. > > There seems to be a couple issues at play here. One is the non-deterministic ordering of thread-related outputs, which is expected and we can't do much about it. Though I'd expect a thread exit notification to always show up, and not be swallowed by GDB. > > The other is the non-deterministic position of the gdb prompt, even for all-stop mode. Sometimes it shows up before GDB gets a chance to output other messages, like so: > > Executing on target: kill -9 3742839    (timeout = 300) > spawn -ignore SIGHUP kill -9 3742839^M > continue^M > Continuing.^M > Unable to fetch general registers.: No such process.^M > (gdb) [Thread 0xfffff7e281e0 (LWP 3742842) exited]^M > ^M > Program terminated with signal SIGKILL, Killed.^M > The program no longer exists.^M > FAIL: gdb.threads/killed-outside.exp: prompt after first continue (timeout) > That's a GDB bug. GDB shouldn't have given the prompt so soon. I think it did because the "No such process" error escapes out.