Date: Wed, 20 May 2015 14:26:18 -0700 From: Xin Li <delphij@delphij.net> To: Matthew Ahrens <matt@mahrens.org>, Alexander Kabaev <kabaev@gmail.com> Cc: John Baldwin <jhb@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282971 - in head/sys: kern sys Message-ID: <555CFBFA.5040707@delphij.net> In-Reply-To: <CAKUb7ivud%2BSEx9N3NPtWff7xSaKAprsFOVCpERdjZ8K-jHtZWA@mail.gmail.com> References: <201505151350.t4FDocQT054144@svn.freebsd.org> <20150520120046.268dde86@kan> <CAKUb7iv0xTtivBb9TXMG_iTBJp2m-E8i87cDLutMfhk4BJnK4w@mail.gmail.com> <20150520134101.69e555d7@kan> <CAKUb7ivud%2BSEx9N3NPtWff7xSaKAprsFOVCpERdjZ8K-jHtZWA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <delphij@delphij.net> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?555CFBFA.5040707>