From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by sourceware.org (Postfix) with ESMTPS id 00FA23858C83 for ; Fri, 3 Mar 2023 17:59:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 00FA23858C83 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4PSwj64zmPz3sgj for ; Fri, 3 Mar 2023 17:59:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PSwj643nNz3s1R for ; Fri, 3 Mar 2023 17:59:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677866378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MvTutu2MIrYhpPjza9E3O/VZG/EgQnn1ky6EYSHqwXE=; b=cQRpr/z/6gM8e4w20JNfO56wY0osq4XtTyBpbZDgzv3xxc2Q6+B1GV8RVhvYld6OQttqNS gueA1FfmPEpKg8fmFLuMTtdO9Hg/Qcvycq6kJDuNej6aRrpoaieZ+fxvt9dQnv5nUStaXd 3op7DFbqDW5Z6iP8iMwDksHRYpcxIl8zFm9i/ep+RIOVZtrtwRt+hPUEFOtf7UG26BfPaj LEMQNGmCcdj7U7H/TUzJcN4PMuuR28Ub1qkc3wEqZR2kMc7+tVa2oZ3Erf+zx3ZdBpNB6Z YsCGIoRNNh1D/kJqt7TKda8046ZYb88Yb/6OLR2/1VUWBCgwm9FHJOww31vrYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677866378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MvTutu2MIrYhpPjza9E3O/VZG/EgQnn1ky6EYSHqwXE=; b=wV/5F4PrYzbitoFtx6cQYGoRKrxAfgGujkFsAjX+fYo4BIKTvHqYWSSrcy6xTn5/6wgv4A puylCDnMxYP3J6wy6S5uVQXELT8FXd1Ng2dhVYPUyWOjAEIUUAPRC5kozRCqYsccANnj7x 6hJGxzL1m4pSWKngLKBmY3ftmCjRJAK2O6bPrlB0N4g1Kig/fwOE5EkscJ+d1OIGH+RsJo YMd7R/dEcdoAP5UnxW+/xkT2XgZyVO3T2p/RoVks1+P4XwVk8jKBNk95YPbQbgPyvIiZK/ RnEsi3RbY/X7VRrucg9jOxEjnR+81oaIR+hOC8zLtKU15GBLOpQXK9GHxkK2HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677866378; a=rsa-sha256; cv=none; b=Oamt0bnJtwpMhNky/jX+wtJdFMllr6JYANz8aWLEwDs3WbfiIe0DEJ8vVJFDuWU8fKLgRn A77aTN+gzNL7WkVs6WiXYiKjNe7z4d7Wxm+C8jIA06nnX+nxPY9OxVAgnaf7LlT7IY2kv9 7IEeVbrXCLxKqhV3gcaY/KdcF+Dzd0zokS2DuFQEdZGS8HpTew9f3ZOSkgerTfXztMw/QL 1RAAJxAJyGevMJbA3X9hdnH0UDa2Lz1Rm+cqOmb+205SZy6eKnKy/9x+zn6K8u5uCge0a1 4X3lslw9g+3CKoJws+G+tL4kOxR6hIGhiS6y3uTv9gxtbuHASuT2Xl2+brtFHw== Received: from [IPV6:2601:648:8680:16b0:483d:fe94:4ad0:801f] (unknown [IPv6:2601:648:8680:16b0:483d:fe94:4ad0:801f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PSwj61rfHz137N for ; Fri, 3 Mar 2023 17:59:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Fri, 3 Mar 2023 09:59:37 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: [PING] [PATCH 0/5] Various test suite fixes (mostly thread related) Content-Language: en-US From: John Baldwin To: gdb-patches@sourceware.org References: <20230217203818.11287-1-jhb@FreeBSD.org> In-Reply-To: <20230217203818.11287-1-jhb@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2/17/23 12:38 PM, John Baldwin wrote: > I've been working on a series of patches for the FreeBSD native target > to fix various issues with multiprocessing over the past month or two. > During that time I have fixed a few issues in various tests I've > observed so far. This series is just some of the test fixes. > > Patch 1 fixes a Linux-specific assumption about PTHREAD_STACK_MIN. > There are a couple of other tests that also hardcoded > PTHREAD_STACK_MIN*2, but I haven't observed crashes with those on > FreeBSD so haven't adjusted those. However, it might be more correct > to apply this same logic to the other tests as well. > > Patch 2 fixes some Linux-specific assumptions about system call > catching. The test still has some failures on FreeBSD that I might > need to adjust in the FreeBSD native target (FreeBSD reports a single > event for exec for example that is just the TARGET_WAITKIND_EXECD but > not a separate syscall exit event, and I think a similar issue might > also exist for fork events.) However, FreeBSD now passes at least > some of the tests compared to passing zero before. > > Patches 3 and 4 fix synchronization issues where tests were assuming > that if the main thread calls pthread_create and then exits, the new > thread will start executing bofore the main thread exits. That isn't > guaranteed to be true as a given kernel scheduler may create the new > thread and place it on a run queue but not preempt to it and return to > the main thread letting it exit before the new thread runs and reports > an event to say it has been born. Use a pthread_barrier to ensure the > requirements of the test instead. There are likely other instances of > this, these are just the two I've noticed so far. I wonder if Linux > reports thread creation events when the thread is created rather than > when it starts executing which might explain why these tests have this > assumption? > > The last patch is a bit more of a RFC and probably not really the way > we want to fix the issue. Some tests assume that the format of 'info > threads' is to have thread identifiers start with "Thread". However, > some targets use a different format. For example FreeBSD's native > target refers to threads as "LWP ". There are some existing > tests that use a looser regex here already rather than requiring the > word "Thread". I wonder if we want to define a helper macro or > variable or like to contain the regex to use for matching on a valid > thread identifier instead? > > John Baldwin (5): > gdb.threads/multi-create: Double the existing stack size. > gdb.base/catch-syscall.exp: Remove some Linux-only assumptions. > gdb.threads/execl.c: Ensure all threads are started before execl. > gdb.threads/next-bp-other-thread.c: Ensure child thread is started. > gdb tests: Allow for "LWP" in thread IDs from info threads. > > gdb/testsuite/gdb.base/catch-syscall.c | 4 ++ > gdb/testsuite/gdb.base/catch-syscall.exp | 48 +++++++++++++++++-- > .../gdb.multi/multi-target-thread-find.exp | 2 +- > gdb/testsuite/gdb.python/py-thrhandle.exp | 2 +- > .../gdb.server/stop-reply-no-thread-multi.exp | 8 ++-- > gdb/testsuite/gdb.threads/execl.c | 8 ++++ > gdb/testsuite/gdb.threads/execl.exp | 6 +-- > .../gdb.threads/fork-child-threads.exp | 2 +- > .../gdb.threads/fork-thread-pending.exp | 16 +++---- > .../gdb.threads/info-threads-cur-sal.exp | 8 ++-- > .../gdb.threads/interrupt-while-step-over.exp | 2 +- > gdb/testsuite/gdb.threads/leader-exit.exp | 2 +- > gdb/testsuite/gdb.threads/manythreads.exp | 2 +- > gdb/testsuite/gdb.threads/multi-create.c | 8 +++- > .../gdb.threads/next-bp-other-thread.c | 9 ++++ > .../gdb.threads/no-unwaited-for-left.exp | 4 +- > gdb/testsuite/gdb.threads/non-ldr-exc-2.exp | 2 +- > gdb/testsuite/gdb.threads/pthreads.exp | 8 ++-- > .../signal-command-handle-nopass.exp | 2 +- > ...ignal-command-multiple-signals-pending.exp | 2 +- > .../signal-delivered-right-thread.exp | 2 +- > gdb/testsuite/gdb.threads/signal-sigtrap.exp | 4 +- > gdb/testsuite/gdb.threads/staticthreads.exp | 2 +- > .../gdb.threads/thread-specific-bp.exp | 2 +- > gdb/testsuite/gdb.threads/thread-specific.exp | 4 +- > gdb/testsuite/gdb.threads/tls.exp | 12 ++--- > gdb/testsuite/gdb.trace/report.exp | 2 +- > gdb/testsuite/gdb.trace/strace.exp | 2 +- > 28 files changed, 120 insertions(+), 55 deletions(-) Ping. -- John Baldwin