From nobody Wed Mar 22 02:19:49 2023 X-Original-To: freebsd-stable@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 4PhByJ1Gqyz418QZ for ; Wed, 22 Mar 2023 02:20:08 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic317-21.consmr.mail.gq1.yahoo.com (sonic317-21.consmr.mail.gq1.yahoo.com [98.137.66.147]) (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) by mx1.freebsd.org (Postfix) with ESMTPS id 4PhByH2LVqz3Mcm for ; Wed, 22 Mar 2023 02:20:07 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=aklXHrW8; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.66.147 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1679451605; bh=QaugndMhKoSSDQMljseFUap2ZEn+fnaLV3G80oyZnV8=; h=From:Subject:Date:Cc:To:References:From:Subject:Reply-To; b=aklXHrW8MMBzLxK72gOJJeohe28c3dWAfXK0PhJPc3+RLSGLvFcVSSnVQ8mg73VyI3zaDnjkj2MBR6btyFCl0QtGLLM0Q8VIenVpDAOtCfAi/X8dM8/iymkYd313nMLCjSsrrYgKb43saQ1XSL2pMQ3+A01DByDY/5+jhsSMZYZAXsS4llo0rZuN8uqaVqS1Noy9vf1OqQWhrYl/iQqoEveDe6Xg3gB/xaPiF47OeIls7Woxk0v5lNh565dhiRWfiSfz1KJYou7UIliWA9q0Imumom8uYZCv5DCh2xQ77BWBZcx9B06e0sSAnhL73hhxeFT1pwFnDzE3nNNDEYtKZw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1679451605; bh=wrvsJxXibmtaBEn4FH7h6JAPQngdvAz2W/IaonTe5yU=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=rilPYuKmNpcNYNDHE54K9kCh3KQBQgbuVzC5QezE4CjE8fsdiLhK3vF1O8r/hzaKU7ukZoSsPPNnPzSXa/7LQ4eHjHViEw47kqeZZqBeyn/jmT1w/hINUOYMMY9SSjN3mi7kWg3jg8slRKRHQ35J9QWvokKLIgZ8FfhxVAosaLNxdDJIETcBa+opH31UwcYhTL9ZDJEdv9xT8uqEBkkcOt7Qz12JRhR7o5PwRnU4u64mxLWKnYsWfQxgl9FPOx40pOQTVKFXgFPlca8bhgBK5LmCggmTNVDF4nMpe1h7zqLyRIrBWXpXiCksT2NHB0lsLfNGcYZ4cZLbqzQ89CsaOw== X-YMail-OSG: g3kVyDwVM1k1yc0tb7IbR5pcfWhta5b7fLI3VfmgY6gw047NbDSmSkj.btEIWfK vMLnkONCyPgSXJ4dljTY5vUOZM606nArEoYcz9L0f.tQ0IYAlGASahmCYOggT57HN0I0i6guKq8v q2QWjbHdjnCOq0wxkJrHF8C.UIObLYGmLMgYivK._hCuOiGRKmDqVnNACrmmjO3ClyaSPDLLnkw2 HrC8HD8itMIPcRKMwE6X1rt6evj5QIZC3gct1pwZ45bQ74RLxjX4SUM5gyDIeD_Q2QosveWh3r6Z p95mPGTCZaLXD4EgT9tJhK.M0uJdsDmQumzK7Uro78aOAbnF5hB6Bu8emmEQVZK8V0CcU784xzmL 1FYrv_42gun5MpcAVfuM3YNzDQYvEkYbJMo_WzAwrfivza1IHO_4cMOgwM0fEGtBR_jPBbTasOIy ZnAbQ6MgBaJI8vgY.6quKuDIez5Epk4wDm6BqYbXIVQUqkWOmSRyAT31R7yk4eNvTvvdWfhxBemK NUb58jN70H9EJDhArMNQ9qVj36qspKEwNglCbu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lsZUomEhKnwIhpa .15r39sqkmdl4Y0lbwXu3plo0jvE.S2YyaZyPUDfxSZAiMK8ruls_XyZW7g5V6_FlAeWM.9zGxQf u6XhHC4deCHBYm2XZ5twPlGF00qf8A7Lvam89yPj43dJT7dsO2D6YRvHZfuNa7KFnOQf6xez2aDu Da_uRFcvepdjVlmIUjmlCY379UylQRatJHjCgEGodK1WSzd09PpsqxDPdX0FW6TPJt377ExiheqU 99BjbNp9KFzHqgTzaCPF6qCx9aNZAHXsa.S8ifesCCLgY5Z.Oz1dv2a3zWUCQtn4JKZBzennNP4c 7nposgSFqzqSmB8D_9XHszK0LsiVKYED2kjDjrB9WhR8bfi4JYtAomn3UzZR12RK_LerakkxKpqi 0lSW0gyIGh6cfjL5hnD3yyUPEuQRvaemyRwEMwM9ZnX7uRSR3lwLeHz.P8TwVCxP0hbMBs4JAlSr XINbPCb3O2zTE3C6_.SQ2Tmy6KjTvatnAGuxILPfl.7Vt8NgwK0gkC_mtg9kNeWBYq1tEBcky6Rv ORLRrpwyIelWm1GIAvAbRDIEBe2sTyU6u_5FCOyBFR.EDOZa5lBzvUDxNiPM.DxN.qL7o4vKbM6l MPFnDNKeR.lz6H6SZaXZpVAl09ZiOk_RR6CxQTGyPtlwqBsH3ZpCAYIE1wbca98GyoLIfz1VrPiH D9WO09lex X-Sonic-MF: X-Sonic-ID: a26a8db2-2504-4b27-9bf3-60897bc3c850 Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.gq1.yahoo.com with HTTP; Wed, 22 Mar 2023 02:20:05 +0000 Received: by hermes--production-bf1-777648578f-gc4ts (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 5d1d6b5f5975dac391555b08f3707ea8; Wed, 22 Mar 2023 02:20:02 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: releng/13.1 amd64 atomic_fcmpset_long parameter order and dst,expect,src (source) vs. src,dst,expect (crash dump report) Message-Id: Date: Tue, 21 Mar 2023 19:19:49 -0700 Cc: George Mitchell To: FreeBSD-STABLE Mailing List , FreeBSD Toolchain X-Mailer: Apple Mail (2.3731.400.51.1.1) References: X-Spamd-Result: default: False [-3.10 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.60)[-0.597]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.66.147:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[freebsd-stable@freebsd.org]; TO_DN_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[yahoo.com]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.66.147:from] X-Rspamd-Queue-Id: 4PhByH2LVqz3Mcm X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N Anyone know what to make of the below mismatch between the source and what crash log is reporting about the atomic_fcmpset_long parameter order? A releng/13.1 sys/amd64/include/atomic.h has the likes of: int atomic_fcmpset_long(volatile u_long *dst, u_long *expect, u_long = src); Note the order: dst, expect, src. Later it has the implementation: /* * Atomic compare and set, used by the mutex functions. * * cmpset: * if (*dst =3D=3D expect) * *dst =3D src * * fcmpset: * if (*dst =3D=3D *expect) * *dst =3D src * else * *expect =3D *dst * * Returns 0 on failure, non-zero on success. */ #define ATOMIC_CMPSET(TYPE) \ static __inline int \ atomic_cmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE expect, u_##TYPE = src) \ { \ u_char res; \ \ __asm __volatile( \ " lock; cmpxchg %3,%1 ; " \ "# atomic_cmpset_" #TYPE " " \ : "=3D@cce" (res), /* 0 */ \ "+m" (*dst), /* 1 */ \ "+a" (expect) /* 2 */ \ : "r" (src) /* 3 */ \ : "memory", "cc"); \ return (res); \ } \ \ static __inline int \ atomic_fcmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE *expect, u_##TYPE = src) \ { \ u_char res; \ \ __asm __volatile( \ " lock; cmpxchg %3,%1 ; " \ "# atomic_fcmpset_" #TYPE " " \ : "=3D@cce" (res), /* 0 */ \ "+m" (*dst), /* 1 */ \ "+a" (*expect) /* 2 */ \ : "r" (src) /* 3 */ \ : "memory", "cc"); \ return (res); \ } ATOMIC_CMPSET(char); ATOMIC_CMPSET(short); ATOMIC_CMPSET(int); ATOMIC_CMPSET(long); which still shows dst,expect,src for the order. But a releng/13.1 crash dump log shows the name order: src, dst, expect (in #7 below): #4 0xffffffff80c1ba63 in panic (fmt=3D) at /usr/src/sys/kern/kern_shutdown.c:844 #5 0xffffffff810addf5 in trap_fatal (frame=3D0xfffffe00b555dae0, eva=3D0) at /usr/src/sys/amd64/amd64/trap.c:944 #6 #7 0xffffffff80c895cb in atomic_fcmpset_long (src=3D18446741877726026240,=20= dst=3D, expect=3D) at /usr/src/sys/amd64/include/atomic.h:225 The atomic_fcmpset_long (from a mtx_lock(?) use) got a: Fatal trap 9: general protection fault while in kernel mode crash. The code was inside nfsd. ( Note: 18446741877726026240 =3D=3D 0xfffffe00b52e9a00 ) The crash is not mine. It is a new type of example from an ongoing crash-evidence gathering session. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267028#c147 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267028#c148 =3D=3D=3D Mark Millard marklmi at yahoo.com