From owner-svn-src-head@freebsd.org Tue Mar 7 06:47:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7915AD01EE1; Tue, 7 Mar 2017 06:47:36 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 6AE0D1B93; Tue, 7 Mar 2017 06:47:36 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id A124617DA3; Mon, 6 Mar 2017 22:47:36 -0800 (PST) Date: Mon, 6 Mar 2017 22:47:36 -0800 From: Hiren Panchasara To: "Ngie Cooper (yaneurabeya)" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r314813 - head/sys/kern Message-ID: <20170307064736.GC71537@strugglingcoder.info> References: <201703070020.v270K2vA039655@repo.freebsd.org> <9747B513-8D23-487D-8FF9-721265C1CF44@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Km1U/tdNT/EmXiR1" Content-Disposition: inline In-Reply-To: <9747B513-8D23-487D-8FF9-721265C1CF44@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Mar 2017 06:47:36 -0000 --Km1U/tdNT/EmXiR1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 03/06/17 at 07:08P, Ngie Cooper (yaneurabeya) wrote: >=20 > > On Mar 6, 2017, at 16:20, Hiren Panchasara wrote: > >=20 > > Author: hiren > > Date: Tue Mar 7 00:20:01 2017 > > New Revision: 314813 > > URL: https://svnweb.freebsd.org/changeset/base/314813 > >=20 > > Log: > > We've found a recurring problem where some userland process would be > > stuck spinning at 100% cpu around sbcut_internal(). Inside > > sbflush_internal(), sb_ccc reached to about 4GB and before passing it > > to sbcut_internal(), we type-cast it from uint to int making it -ve. > >=20 > > The root cause of sockbuf growing this large is unknown. Correct fix > > is also not clear but based on mailing list discussions, adding > > KASSERTs to panic instead of looping endlessly. > >=20 > > Reviewed by: glebius > > Sponsored by: Limelight Networks > >=20 > > Modified: > > head/sys/kern/uipc_sockbuf.c > >=20 > > Modified: head/sys/kern/uipc_sockbuf.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=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/kern/uipc_sockbuf.c Tue Mar 7 00:13:53 2017 (r314812) > > +++ head/sys/kern/uipc_sockbuf.c Tue Mar 7 00:20:01 2017 (r314813) > > @@ -1043,6 +1043,11 @@ sbcut_internal(struct sockbuf *sb, int l > > { > > struct mbuf *m, *next, *mfree; > >=20 > > + KASSERT(len > 0, ("%s: len is %d but it is supposed to be +ve", > > + __func__, len)); > > + KASSERT(len <=3D sb->sb_ccc, ("%s: len: %d is > ccc: %u", > > + __func__, len, sb->sb_ccc)); > > + > > next =3D (m =3D sb->sb_mb) ? m->m_nextpkt : 0; > > mfree =3D NULL; >=20 > The KASSERT is bad ? please fix it. From https://ci.freebsd.org/job/FreeB= SD-head-amd64-test/1994/console : >=20 > add host 127.0.0.1panic: sbcut_internal: len is 0 but it is supposed to b= e +ve Thanks, fixed in r314838. Cheers, Hiren --Km1U/tdNT/EmXiR1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJYvleAXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lZfsH+wf+0HGVDnkdB8vjMvONxDgE abQh4BPHQw+t/Bafr3P908ivdL4eTgRszwisjXt6vKqB+7neKmPgv6Ojdd2E0UL3 mGmmpKCikmxdFBfcUbGa1wY7my+MqHJ0j0s56GdJP9rTr9OluTjpwGztC29L8RNR nSSBi8DmNK7mkQ9ux8RCp1SaXV/9PY5r04O2JmDcpwbgx0hNgt1GbOj5CU1tVyvH dq72COuLIb5DV8owrMHSPKdjZPir/MHd9vl2IN+42CQvHHRNSoAObMYpuGJMgGMN rW2HI0o0SD2nEiNENXpYsmL371bjNt6mAAfDZwoKaqByUqKtuphyeR3xhU0mvm0= =d5aA -----END PGP SIGNATURE----- --Km1U/tdNT/EmXiR1--