From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 12B1F3858C27 for ; Wed, 24 Nov 2021 14:16:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 12B1F3858C27 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-266-dBZVTJtTOpaGt_YrYpj83g-1; Wed, 24 Nov 2021 09:16:30 -0500 X-MC-Unique: dBZVTJtTOpaGt_YrYpj83g-1 Received: by mail-wm1-f69.google.com with SMTP id ay34-20020a05600c1e2200b00337fd217772so1536296wmb.4 for ; Wed, 24 Nov 2021 06:16:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Gz4hVnW3wUxPupK9L7SxKuPECw3at3yg9iQFxS9lWGA=; b=U3prwKhM2ZVDAHr8+utPWDTG/cb4cwCdMAE5hkHus5fYyV/i7IHXk20BMpIIbGqAxK ppsoLQesMj6YxIrgz/AkwK7ADKWgsly7Ng/7YCvnju1dm6mFwP7od1lQLzZgkf+emsQ7 GvvTgPysjSyhM4lD8skPM3nyU1yyxZvaKWCTgPBne1N6M83oDmhC85IjOs7wL7X2BeY4 kCouLFuzghW6Wf9snxUlfAoaP4vGXQPkn28Xv7ozr6O6/Q9hdGjytnC9xNkrbTC9P2u6 OjH6BK9mCBuu97bMdKpfqniN9BNqm5b77krMmQ9nV6imZ5M3h3wkUa4NuknxNUK4CZuP Zz7Q== X-Gm-Message-State: AOAM532On7a6PpihG9RvUK2Ct4gxjvP3FvCpujy+JvbWVjWxA3W6X6G4 PEhG2AxusxTRgpWVYn5VAuPiiIZqhkhrdjU76W7Yp7yhMZogQKgb+7rCWYIj1BVeLzdzuewl5zw ZQc21iOydB67Ng/IDAV9k6Q== X-Received: by 2002:a05:600c:1e8d:: with SMTP id be13mr15536581wmb.79.1637763389134; Wed, 24 Nov 2021 06:16:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIyIbutxzxLPj7JhJ6tJ0KoitIbsh76T3McyqOrNsWGS/yX6fPC4xBBfvGrs3RletP8RozDA== X-Received: by 2002:a05:600c:1e8d:: with SMTP id be13mr15536546wmb.79.1637763388891; Wed, 24 Nov 2021 06:16:28 -0800 (PST) Received: from localhost (host86-166-129-255.range86-166.btcentralplus.com. [86.166.129.255]) by smtp.gmail.com with ESMTPSA id h2sm14903685wrz.23.2021.11.24.06.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 06:16:28 -0800 (PST) Date: Wed, 24 Nov 2021 14:16:27 +0000 From: Andrew Burgess To: John Baldwin Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 06/13] inf-ptrace: Raise an internal_error if waitpid() fails. Message-ID: <20211124141627.GF2662946@redhat.com> References: <20210803185000.22171-1-jhb@FreeBSD.org> <20210803185000.22171-7-jhb@FreeBSD.org> MIME-Version: 1.0 In-Reply-To: <20210803185000.22171-7-jhb@FreeBSD.org> X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 14:11:45 up 5 days, 3:10, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 24 Nov 2021 14:16:33 -0000 * John Baldwin [2021-08-03 11:49:53 -0700]: > Previously this returned a TARGET_WAITKIND_SIGNALLED event for > inferior_ptid. Since the multi-target changes, inferior_ptid is now > invalid during ::wait() methods, so this triggered an assertion > further up the stack. > --- > gdb/inf-ptrace.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c > index afa38de6ef7..1f8e72d1aca 100644 > --- a/gdb/inf-ptrace.c > +++ b/gdb/inf-ptrace.c > @@ -319,14 +319,9 @@ inf_ptrace_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus, > > if (pid == -1) > { > - fprintf_unfiltered (gdb_stderr, > - _("Child process unexpectedly missing: %s.\n"), > - safe_strerror (save_errno)); > - > - /* Claim it exited with unknown signal. */ > - ourstatus->kind = TARGET_WAITKIND_SIGNALLED; > - ourstatus->value.sig = GDB_SIGNAL_UNKNOWN; > - return inferior_ptid; > + internal_error (__FILE__, __LINE__, > + _("Child process unexpectedly missing: %s.\n"), > + safe_strerror (save_errno)); > } Single statement if blocks should not have '{ ... }' around them. I wonder if we could use perror_with_name here instead of internal_error, there's at least one place this is done in linux-nat.c. Thanks, Andrew > > /* Ignore terminated detached child processes. */ > -- > 2.31.1 >