From nobody Tue Nov 14 01:01:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4STp023RvJz50VHH; Tue, 14 Nov 2023 01:01:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4STp021cRzz4SVG; Tue, 14 Nov 2023 01:01:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699923682; 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; bh=IMSNkSMzW3+4C/Mv28wdFjZl2jAuu887G4YL/JTH2Uc=; b=gTpoC05pyC54ZN6Bt72tBt/Y/TOtYzX0i0MT4Ai0plAKSbWjBo8z7kxv4a4X0XneCKjUnx it7R9PjEnDx0CTq/gutMIl3yl1jnBqPYHvxwHt2yV0laGy+6LWKOeMNMepw/rupi4Yuy9P 1hrJdoyRItjvplzrdWEKeqLPpp4ernjFR7ChBVL1ETBA6tgZZfq1f/HkMW5GZG7haTQ357 dePBe+fS2GI1YkeRGq6iBnB08xCkgK8mIky0q7Mu78KkZ3m/bHIhN8ZL5ZB9RErwZC3Ib6 snEk/OqVGTZpyHAuZugrOJxTGMcQUqzqgVc0JWw4O2N+w4XF33VMWDpATZo10A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699923682; 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; bh=IMSNkSMzW3+4C/Mv28wdFjZl2jAuu887G4YL/JTH2Uc=; b=iShivzN6LI4sBJb7aK0P8vqKIlcMHwJ+j5sLLRXsVM/xmTIfMiouaFwpf4pmN4mkOn1cHd JAHE3kupQenI9jdImZDw7/W63aqFmsAo5U0U0LmwoY51p6uaPg9prcwcNOvkDDtzMnCTJI e4z0c6ZGznlXB6vUNhIU0V8dowO8KbbzTtXb5rpUXLI4aZfiUqEEd4O5gkbw9vL637Jxju KttJfPmTUa0v1lUjoG4tyiKvDTObgCl+q9FX6mLEkFj3i4N0VyeBJv4rozz0haMc6xKfsP vYGX7HGoC+6i9CgpPnfhbxmNy+YW4SGrg9jh8/1cTOzidek7KyiGzMRDV3WXsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699923682; a=rsa-sha256; cv=none; b=P3oD2vS8h5EOIiVx2sLeMR+yCJRUhDw9bnnq38Bf7UscX0dRqMd6kQEt8cT9tpznPHVgvm a8yGRhlKaY9I/T73H7klWnepqrydQWjzBuB5uKuqc7F8z4A+z+WqIw6nMwOfZmMH62ITCT yYe/bMiWK4YAnLND78WvYGFJti8ORlNPD+EvYi2FrLOQQOaaZOJQE2Loju7FnQFpWov3w8 noqYWrvLjEjqrpAXxkcgS5tC90Vtjism5IFC9twKxqxiRhyDJrdpzOVOoCvmBj+hyx3Tzv YUkb2utSmYk1ad4HbHCrq1oz50c1nbNYrdeJFyhs2L7YQm5XdEBWVkOIbWcJTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4STp020g9mzCnF; Tue, 14 Nov 2023 01:01:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AE11Lnd027110; Tue, 14 Nov 2023 01:01:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AE11L4a027107; Tue, 14 Nov 2023 01:01:21 GMT (envelope-from git) Date: Tue, 14 Nov 2023 01:01:21 GMT Message-Id: <202311140101.3AE11L4a027107@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 9b57e30cf5b6 - main - abort2: Generate a core dump List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b57e30cf5b6036263a1a2551df8574571c6f5a4 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9b57e30cf5b6036263a1a2551df8574571c6f5a4 commit 9b57e30cf5b6036263a1a2551df8574571c6f5a4 Author: John Baldwin AuthorDate: 2023-11-14 01:00:52 +0000 Commit: John Baldwin CommitDate: 2023-11-14 01:00:52 +0000 abort2: Generate a core dump Call sigexit rather than exit1 so that a core is generated. If running the SIGABRT handler is desired, this would need to use kern_psignal() instead. In that case a userspace wrapper in libc would be needed to force an exit if the handler doesn't exit. Given that abort2(2)'s intended use case is when userland is in a sufficiently bad state such that it can't safely call syslog(3) before abort(3), a userspace abort2(3) wrapper in libc might be dubious. Reviewed by: Olivier Certner , emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D42163 --- sys/kern/kern_exit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 965f4a431755..f9445a481d92 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -827,8 +827,9 @@ out: sbuf_finish(sb); log(LOG_INFO, "%s", sbuf_data(sb)); sbuf_delete(sb); - exit1(td, 0, sig); - return (0); + PROC_LOCK(p); + sigexit(td, sig); + /* NOTREACHED */ } #ifdef COMPAT_43