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

From: Enji Cooper (yaneurabeya) <"Enji>
Date: Sun, 14 Oct 2018 22:45:53 -0700
> 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


Received on Mon Oct 15 2018 - 03:45:57 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:18 UTC