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 8DBE83858D39 for ; Tue, 14 Mar 2023 18:21:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8DBE83858D39 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 [IPv6:2610:1c1:1:606c::19:1]) (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 4PbhgY1qrcz3HYl for ; Tue, 14 Mar 2023 18:21:45 +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 4PbhgX6nypz3HCW for ; Tue, 14 Mar 2023 18:21:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678818105; 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=JbhJf/P1ZdCKO4p9pixhnIVuMmIr8HKIB5gPLi9dTu8=; b=TzntxsIPNAwmdQ7HuBHcix8tZMdHu745C3KyCig2XeR5p9HDpkiKGeoAl3IrBa5Ht3bnb+ PdOBL5jcD16EcEGu4EhzCDwNZ0D2tILw/QP+bNda6WXuZDiNuB4e82Dt5noEaELS7iMzLZ 9tQUPq5UXR/kkjTt/0sSP+cEiqu1omkU9+1jOumIoSNm7BSCxTl3DiVXOvOgpYKXO0TuJP l2+TE1m5QzyhFJEe+ITLJkCfDzMpy8q3Li+hvz9CC0QTkKlYfVk/DPO2BHWKGNWBUa1Vkj xuG9ZHaSfx5TttJT4pD8VfvWlrqi0FWbx98QwgcYWN1PBnvdFBnPfZMqhpiRBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678818105; 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=JbhJf/P1ZdCKO4p9pixhnIVuMmIr8HKIB5gPLi9dTu8=; b=WZSafAR6cHi8fRm6gpzNLePgb/9mJBPOm+SODI5ZZyUfU1sE6PRg5rROIAcZiCp00rjajR XPaZ0Dq69ztT3mJxnxkMYKooKc8e+NE1r8UOLiRZQP3IoAK0vzYNJ2jnCpljK7+S3A+1CG E/xZIjCG+metUFrl3idwEsn71iWjMzL8ByJBxAy0Ik/mDR3npwxMDBn9InWs+2ExvsryOq oi/CvPV3USt/MQBcqhz7WekK4f9KtwQTpU4D44/MbZ+w55BZz7ZKnfAyc4sNILkcVmjNhm MfcUyQfyHr9fU9JYHrKRBb73+GmQSiHTmEGxWeoJg5/4RaTBZw+8okkIjNNFiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678818105; a=rsa-sha256; cv=none; b=DGjqb/LJpjZFXD2w1l9jgf6vn4QsgzyVJrJ6m6N2TxCp053rKicxdfO+J0ZzcLvjCktb/5 xjavaOjBe4u84jQrm6RTtGetL7fNv4pcbek/EZY7E2Dff1T4aK0Nz1gI0PuQdb6bDDQx22 cNC8EZt6i+v0LFrndUNUjYrv6G/1fIA9jd0SS+8dJkUdYbXHGsgCb0zoYe/H/zXnOR9lpg Al+xeOY/S3QamJW+LS7cmKawwxn3nCNiS370swu7gyOgeP8EH7PFynL5I4IpDGuNjzC45C w3+RqamtZaX3u6XMoozIitnJCCsklfSiiq4kPPdZtJDd9uozDZfDkN3aow/iHA== Received: from [IPV6:2601:648:8680:16b0:65:d93b:7a5b:8df4] (unknown [IPv6:2601:648:8680:16b0:65:d93b:7a5b:8df4]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PbhgX4Ybtzh4s for ; Tue, 14 Mar 2023 18:21:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <497abe03-4ac2-80b8-2f48-26c804ea773c@FreeBSD.org> Date: Tue, 14 Mar 2023 11:21:41 -0700 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/9] Fixes for multiprocess for FreeBSD's native target Content-Language: en-US From: John Baldwin To: gdb-patches@sourceware.org References: <20230228181845.99936-1-jhb@FreeBSD.org> In-Reply-To: <20230228181845.99936-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,RCVD_IN_MSPIKE_H2,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/28/23 10:18 AM, John Baldwin wrote: > When I originally added multiprocess support to the FreeBSD target I > did not fully understand what that meant. This series seeks to fix > several of my incorrect assumptions (e.g. the need to resume multiple > inferiors for a given call to resume, as well as the need to stop > other inferiors when reporting an event back from wait). > > This does not add support for non-stop mode, but probably gets closer > to being able to support it. > > In terms of test results, the before summary of a testsuite run on > FreeBSD/amd64 is: > > === gdb Summary === > > # of unexpected core files 11 > # of expected passes 98135 > # of unexpected failures 3104 > # of expected failures 58 > # of known failures 125 > # of unresolved testcases 74 > # of untested testcases 58 > # of unsupported tests 818 > # of duplicate test names 10 > > and the summary after this series is: > > === gdb Summary === > > # of unexpected core files 9 > # of expected passes 98586 > # of unexpected failures 3002 > # of expected failures 58 > # of known failures 125 > # of unresolved testcases 54 > # of untested testcases 58 > # of unsupported tests 818 > # of duplicate test names 9 > > Some of these other failures are improved further by the other > testsuite patches I posted earlier involving races in tests, or > matching on the output of 'info threads'. > > I do see a few failures of the new assertions added in this series > still, namely a handful of tests do something I'm not sure is > expected: they schedule multiple individual threads from a single > process multiple resume() calls. I think though this may be a test > that is assuming the target supports non-stop when it doesn't. For > example, here are the debugging logs from a test that I caught that > does this: > > Running /home/john/work/git/gdb/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp ... > ... > (gdb) file /usr/home/john/work/git/gdb/obj/gdb/testsuite/outputs/gdb.threads/attach-many-short-lived-threads/attach-many-short-lived-threads > Reading symbols from /usr/home/john/work/git/gdb/obj/gdb/testsuite/outputs/gdb.threads/attach-many-short-lived-threads/attach-many-short-lived-threads... > (gdb) builtin_spawn /usr/home/john/work/git/gdb/obj/gdb/testsuite/outputs/gdb.threads/attach-many-short-lived-threads/attach-many-short-lived-threads > attach 44426 > attach: running_lwps 1 > Attaching to program: /usr/home/john/work/git/gdb/obj/gdb/testsuite/outputs/gdb.threads/attach-many-short-lived-threads/attach-many-short-lived-threads, process 44426 > [New LWP 959198 of process 44426] > [New LWP 959404 of process 44426] > [New LWP 959532 of process 44426] > [New LWP 959544 of process 44426] > [New LWP 959568 of process 44426] > ... > [Switching to LWP 432744 of process 44426] > _nanosleep () at _nanosleep.S:4 > 4 PSEUDO(nanosleep) > (gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: attach > info threads > Id Target Id Frame > * 1 LWP 432744 of process 44426 _nanosleep () at _nanosleep.S:4 > 2 LWP 959198 of process 44426 "detached" _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:40 > ... > (gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: no new threads > set breakpoint always-inserted on > (gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: set breakpoint always-inserted on > break break_fn > Breakpoint 1 at 0x400ebc: file /home/john/work/git/gdb/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.c, line 57. > (gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: break break_fn > set debug infrun on > (gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: set debug infrun on > set debug fbsd-nat on > (gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: set debug fbsd-nat on > continue > Continuing. > [infrun] clear_proceed_status_thread: 44426.432744.0 > [infrun] clear_proceed_status_thread: 44426.959198.0 > [infrun] clear_proceed_status_thread: 44426.959404.0 > ... > [infrun] clear_proceed_status_thread: 44426.960473.0 > [infrun] clear_proceed_status_thread: 44426.960474.0 > [infrun] clear_proceed_status_thread: 44426.960475.0 > [infrun] proceed: enter > [infrun] user_visible_resume_ptid: resuming all threads of current process > [infrun] proceed: addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT > [infrun] scoped_disable_commit_resumed: reason=proceeding > [infrun] start_step_over: enter > [infrun] start_step_over: stealing global queue of threads to step, length = 0 > [infrun] operator(): step-over queue now empty > [infrun] start_step_over: exit > [infrun] proceed: start: resuming threads, all-stop-on-top-of-non-stop > [infrun] proceed: resuming 44426.432744.0 > [infrun] resume_1: step=0, signal=GDB_SIGNAL_0, trap_expected=0, current thread [44426.432744.0] at 0x823baf64a > [infrun] internal_resume_ptid: non_stop uses inferior_ptid > [infrun] do_target_resume: resume_ptid=44426.432744.0, step=0, sig=GDB_SIGNAL_0 > [fbsd-nat] resume: start: [LWP 432744 of process 44426], step 0, signo 0 (0) > [fbsd-nat] resume_one_process: [LWP 432744 of process 44426], step 0, signo 0 (0) > [fbsd-nat] resume: end: [LWP 432744 of process 44426], step 0, signo 0 (0) > [infrun] infrun_async: enable=1 > [infrun] prepare_to_wait: prepare_to_wait > [infrun] proceed: resuming 44426.959198.0 > [infrun] resume_1: step=0, signal=GDB_SIGNAL_0, trap_expected=0, current thread [44426.959198.0] at 0x821d32ccc > [infrun] internal_resume_ptid: non_stop uses inferior_ptid > [infrun] do_target_resume: resume_ptid=44426.959198.0, step=0, sig=GDB_SIGNAL_0 > [fbsd-nat] resume: start: [LWP 959198 of process 44426], step 0, signo 0 (0) > [fbsd-nat] resume_one_process: [LWP 959198 of process 44426], step 0, signo 0 (0) > pid 44426: running_lwps 1 > /home/john/work/git/gdb/gdb/fbsd-nat.c:1199: internal-error: resume_one_process: Assertion `info->running_lwps == 0' failed. > > I've started on a patch to defer actual process resumes until either > wait or commit_resumed is called, but that has so far caused more > regressions than fixes, so I'm not including it here. Also, the > logged line of 'start: resuming threads, all-stop-on-top-of-non-stop' > when the target is all-stop only makes me think the test is perhaps > broken in this case. Since these patches are all specific to fbsd-nat I can push them, but I was curious if anyone had any feedback? In particular, the target interface is a bit complex and if I have incorrect assumptions in these patches it would be nice to know if there are things I should be fixing further. -- John Baldwin