From owner-svn-src-all@FreeBSD.ORG Wed May 20 21:26:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC7BE6C6; Wed, 20 May 2015 21:26:20 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AC4661914; Wed, 20 May 2015 21:26:20 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [12.229.62.2]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id A4BAE1598C; Wed, 20 May 2015 14:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1432157179; x=1432171579; bh=DJA1MHunBRjHFhcHEIdIyJ6ZIDOAYDQExnvTLVOCQbA=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=zFqvUMoKaGBXUr0oyEs5nul/2Wjyr2s8SjNVuj2zPjZlsocMOU8vyX7RqEsxn31Hu GOU5tn7Wm6Y9aNxpgg6Vfn0UAmyT+KzmnnmJR5IgSieT5HUZyn3KkEkx5isvt6lMwl lEZqNoFjIYzZ1WzD/ec3nr0YFiGmdHGHygDdxSJY= Message-ID: <555CFBFA.5040707@delphij.net> Date: Wed, 20 May 2015 14:26:18 -0700 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Matthew Ahrens , Alexander Kabaev CC: John Baldwin , "src-committers@freebsd.org" , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282971 - in head/sys: kern sys References: <201505151350.t4FDocQT054144@svn.freebsd.org> <20150520120046.268dde86@kan> <20150520134101.69e555d7@kan> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KsELaggJ0G9mclCCCfmUpUon1To2SRKXW" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2015 21:26:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KsELaggJ0G9mclCCCfmUpUon1To2SRKXW Content-Type: multipart/mixed; boundary="------------090201000407090304070005" This is a multi-part message in MIME format. --------------090201000407090304070005 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I think we should also assert that no waiter remains when a conditional variable is destroyed (which also suggests that the memory may be freed shortly). Otherwise we would either have modify after free or lost wakeu= ps. Cheers, --=20 Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die --------------090201000407090304070005 Content-Type: text/x-patch; name="kerncv-assert-waiters-on-destroy.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="kerncv-assert-waiters-on-destroy.diff" Index: sys/kern/kern_condvar.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/kern/kern_condvar.c (revision 283099) +++ sys/kern/kern_condvar.c (working copy) @@ -77,6 +77,7 @@ cv_destroy(struct cv *cvp) #ifdef INVARIANTS struct sleepqueue *sq; =20 + KASSERT(cvp->cv_waiters =3D=3D 0, ("%s: dangling waiters", __func__)); sleepq_lock(cvp); sq =3D sleepq_lookup(cvp); sleepq_release(cvp); --------------090201000407090304070005-- --KsELaggJ0G9mclCCCfmUpUon1To2SRKXW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.1.2 (FreeBSD) iQIcBAEBCgAGBQJVXPv7AAoJEJW2GBstM+nspgwP/1jnGGkXG4CNS/EJGhbg72Q8 HLurRvwyo/9Sh44BTgjnu5M/VGIZuy8DAWRX0bAp/D8bJV6x5yoHr8BygqZLPfFy 5Irb/DpuTCoQJvgQ+kOHqmv4dV5KTQ3FZCUrqE8EB4e+CtbzYCHu3PUu+vE6R81u xmtmyslWAyHgZSiFy2bOB0f04J/RmRtztHJIhFxeTzPkI/n6M6BJwUPaK+0kweBY qkZmTU2WobnHG7XQaDx8i3S4TIByVPE8m1AxUfoccb7lQMY5BtF0z7+Ms8QOVWKn qySRB6NgfnwQrEzq380Tf4wzbA152NxmBx4a3qP2WXHZAugikm6f/I/z1EMx5Yqx nccqxvQwPjStOKZ/0co/0BZzTNejbyYX3z3hjdLcRHQr+Odf3aigD35sh9n8nbnV t+wbvOfjLE4gkuh7b6t5kLjxe/qeQCtLMbwMx0zfLhfw1ucYVjlb2M0/3itDUCeK ZWdT6DitTM0NWRpJ/WACQu4IMUjZJVORIpUL8JhgsTWXPYngfCcvtZa12rhn1HZD K1LZlZvUIgL3j8ijUTj/XvXcQegmoKKpW/7BC1PFA/Qg+nbKJ/h7s+nrbX0lqgZE ULf63OlAQafEA099q08bWVXeNBYQmggJ4iYUH2ud/5b09I4AfYJh3laP7+UMuQ8I j691VBEIpnrkvs8cOW3j =7UGD -----END PGP SIGNATURE----- --KsELaggJ0G9mclCCCfmUpUon1To2SRKXW--