Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Mar 2017 22:47:36 -0800
From:      Hiren Panchasara <hiren@FreeBSD.org>
To:        "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r314813 - head/sys/kern
Message-ID:  <20170307064736.GC71537@strugglingcoder.info>
In-Reply-To: <9747B513-8D23-487D-8FF9-721265C1CF44@gmail.com>
References:  <201703070020.v270K2vA039655@repo.freebsd.org> <9747B513-8D23-487D-8FF9-721265C1CF44@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <hiren@FreeBSD.org> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170307064736.GC71537>