Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Oct 2018 18:55:02 -0700
From:      "Enji Cooper (yaneurabeya)" <yaneurabeya@gmail.com>
To:        Gleb Smirnoff <glebius@freebsd.org>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>, freebsd-net <freebsd-net@freebsd.org>, Jonathan Looney <jonlooney@gmail.com>
Subject:   Re: Relatively deterministic panic with sendfile(2) when running tests in the sxlock code
Message-ID:  <659BA879-AC2D-438C-9182-EE0D3650817C@gmail.com>
In-Reply-To: <20181015131045.GX1044@FreeBSD.org>
References:  <CC816726-7B79-4643-82DD-7B4CF4A25F54@gmail.com> <20181015022518.GV1044@FreeBSD.org> <1B58488D-8615-40E8-9115-E26496A6DBCE@gmail.com> <BA546783-C2DA-4ED9-8391-8408A8B9145B@gmail.com> <D5F7ABC3-89F1-48B9-94B0-067E3DE3F5B2@gmail.com> <20181015131045.GX1044@FreeBSD.org>

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

--Apple-Mail=_38728E3A-302A-4A8C-B58B-C940A83C647E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8


> On Oct 15, 2018, at 6:10 AM, Gleb Smirnoff <glebius@freebsd.org> =
wrote:
>=20
>  Enji,
>=20
> can you please check that with this patch all your tests pass?

Hi Gleb!
	It almost compiled. I just needed to dereference the `so` =
pointer:

$ git diff /usr/src/sys/kern/kern_sendfile.c
diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c
index 438069aa721..50404ce5745 100644
--- a/sys/kern/kern_sendfile.c
+++ b/sys/kern/kern_sendfile.c
@@ -526,6 +526,8 @@ sendfile_getsock(struct thread *td, int s, struct =
file **sock_fp,
        *so =3D (*sock_fp)->f_data;
        if ((*so)->so_type !=3D SOCK_STREAM)
                return (EINVAL);
+       if (SOLISTENING(*so))
+               return (ENOTCONN);
        return (0);
 }


	After I applied that and rebuilt the kernel, it doesn=E2=80=99t =
panic anymore (and it fails with the correct errno).
Thank you so very much :)!
-Enji

--Apple-Mail=_38728E3A-302A-4A8C-B58B-C940A83C647E
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE5bk3FaGcY5rvqmb79YOpJmkwhhUFAlvFRPYACgkQ9YOpJmkw
hhVo9Q/+I2/wI5Ub43TCqbeQ6wBbdXupoc6Au6ZcVi9l8ltTvvtFnh+PYBRWIurW
DfkWHUOhTWYi8pZpCjPftEW18SmF29iie06MWPk7eP/McOMj2rPuLz5JzahI5iwG
OtRyZNU1DGj9Q34S2FVqKFmNR4Q8rB3vjy6IdAAFxA9ZmdG+YbqUGmx2pb7uuFzz
XdbQ8B+G2kpGdIDnKNy16EPQSxT6C6oWxUUwX2trOk1jyQRi1YL0f0hGr4KqwTY/
6NNbzenJicswmYHbArU81O+3JwtEezGM2OzIDNJkpE0YdQXaShr4PHuUanPcO7w5
XiiLIsW6HhvCzTYPBchYd08gnsN/WrhF8qCSIbXK5U0spz1yZj/Z7vIy+U3sgyDD
sc2ClyxxznHMlM0GOek21EOfPVeXAphbhnr80maDq8L41Ju8fpFmllIHClveREb5
ou/WTIT/kQvtVd8igV7lZi0cFoM/v1bd5pXLbO0Tj+4KcJLNYjBo9T3CaY8Xi0O6
OTWOKw3IrpP09+Gmp6zntC33R3uYoe5sLOaYg8j9n2hsqJypCzeG4uESBj78h/29
XjttdW66rAXVZ7Oox6BK4rcM2x5lqPBZZjygQuZ0R3n+dd2fsDVqAlCIxiIhO2Sc
tuHDCIaQgVB0s1GgRb83fO/U5L3VXPRa1YYB4PffWDXVaaEdDmk=
=TwvW
-----END PGP SIGNATURE-----

--Apple-Mail=_38728E3A-302A-4A8C-B58B-C940A83C647E--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?659BA879-AC2D-438C-9182-EE0D3650817C>