Relatively deterministic panic with sendfile(2) when running tests in the sxlock code

Enji Cooper (yaneurabeya) yaneurabeya at gmail.com
Mon Oct 15 05:45:57 UTC 2018


> On Oct 14, 2018, at 10:17 PM, Enji Cooper (yaneurabeya) <yaneurabeya at gmail.com> wrote:

...

> Oh yipes. I guess passing in a server socket (a bound and listening socket) instead of a client socket (connect’ed to a server socket) for `s` will result in a crash?
> 
> From https://github.com/ngie-eign/freebsd/blob/95b96470a3a0270c36c4e7fb5eedc150fe124fac/lib/libc/tests/sys/sendfile_test.c#L479 <https://github.com/ngie-eign/freebsd/blob/95b96470a3a0270c36c4e7fb5eedc150fe124fac/lib/libc/tests/sys/sendfile_test.c#L479>:
> ATF_TC_BODY(s_negative_not_connected_socket, tc)
> {
> 	int client_sock, error, fd, port;
> 
> 	port = XXX_TEST_PORT_BASE + __LINE__;
> 	client_sock = setup_tcp_server(XXX_TEST_DOMAIN, port);
> 
> 	fd = open(SOURCE_FILE, O_CREAT|O_RDWR);
> 	ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
> 
> 	error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0));
> 	ATF_REQUIRE_ERRNO(ENOTCONN, error == -1);
> 
> 	(void)close(fd);
> 	(void)close(client_sock);
> }
> Let me see if I can track this down..

	Can’t repro this on 11.2-RELEASE. Trying 11.2-STABLE.
Thanks!
-Enji

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freebsd.org/pipermail/freebsd-net/attachments/20181014/8a235bff/attachment.sig>


More information about the freebsd-net mailing list