[gnutls-devel] Bug#813598: FTBFS[kfreebsd]: tests/mini-loss-time race

Nikos Mavrogiannopoulos n.mavrogiannopoulos at gmail.com
Mon Mar 7 09:26:16 CET 2016


On Sat, Mar 5, 2016 at 7:57 PM, Steven Chamberlain <steven at pyro.eu.org> wrote:
> Hi Andreas,
>
> In a future upload please could you try the attached diff, which is a
> much simpler way I found to get the testsuite output into the build log.
> Since more than one set of tests runs in parallel, we only currently see
> the test-suite.log for one set of tests, and not all of them.
>
>> On Sat, 2016-03-05 at 17:30 +0100, Andreas Metzler wrote:
>> > Well with 3.4.10 the timeout does not seem to make any difference.
>> > Any of
>> > gnutls_dtls_set_timeouts(session, 1 * 1000, 29 * 1000); [Steven's
>> > patch]
>
> Your commit to the gnutls28 package in experimental
> https://anonscm.debian.org/cgit/pkg-gnutls/gnutls.git/commit/?h=experimental&id=896b247a321271ab61ed1fce5065cadbd472c207
> seems to do the opposite of my patch, it increases the server timeout?
> My patch decreased it:  https://bugs.debian.org/813598#5
>
>> > gnutls_dtls_set_timeouts(session, 1 * 1000, 30 * 1000); [3.4.10]
>> > gnutls_dtls_set_timeouts(session, 1 * 1000, 29 * 1000); [e6dcb14dbbd3e9e40a1f193a7bf6657e82b88cb9]
>> > *always* fails on kfreebsd-amd64.
>
> If it fails _reliably_ now, I consider that an improvement!
> I'll try to test all of the above and see how often each one fails.

That's quite interesting. It seems that the child times out first and
closes the connection prior to parent detecting the timeout. Would the
attached patch solve the issue?

regards,
Nikos
-------------- next part --------------
diff --git a/tests/mini-loss-time.c b/tests/mini-loss-time.c
index 13de21e..8145657 100644
--- a/tests/mini-loss-time.c
+++ b/tests/mini-loss-time.c
@@ -116,7 +116,7 @@ push(gnutls_transport_ptr_t tr, const void *data, size_t len)
 	return send(fd, data, len, 0);
 }
 
-static void client(int fd)
+static void client(int fd, unsigned timeout)
 {
 	int ret;
 	gnutls_anon_client_credentials_t anoncred;
@@ -136,7 +136,7 @@ static void client(int fd)
 	 */
 	gnutls_init(&session, GNUTLS_CLIENT | GNUTLS_DATAGRAM);
 	gnutls_dtls_set_mtu(session, 1500);
-	gnutls_dtls_set_timeouts(session, 1 * 1000, 30 * 1000);
+	gnutls_dtls_set_timeouts(session, 1 * 1000, timeout * 1000);
 
 	/* Use default priorities */
 	gnutls_priority_set_direct(session,
@@ -178,7 +178,7 @@ static void client(int fd)
 /* These are global */
 pid_t child;
 
-static void server(int fd, int packet)
+static void server(int fd, int packet, unsigned timeout)
 {
 	gnutls_anon_server_credentials_t anoncred;
 	gnutls_session_t session;
@@ -196,7 +196,7 @@ static void server(int fd, int packet)
 
 	gnutls_init(&session, GNUTLS_SERVER | GNUTLS_DATAGRAM);
 	gnutls_dtls_set_mtu(session, 1500);
-	gnutls_dtls_set_timeouts(session, 1 * 1000, 30 * 1000);
+	gnutls_dtls_set_timeouts(session, 1 * 1000, timeout * 1000);
 
 	/* avoid calling all the priority functions, since the defaults
 	 * are adequate.
@@ -265,17 +265,17 @@ static void start(int server_packet, int wait_server)
 		/* parent */
 		close(fd[0]);
 		if (wait_server)
-			server(fd[1], server_packet);
+			server(fd[1], server_packet, 30);
 		else
-			client(fd[1]);
+			client(fd[1], 30);
 		close(fd[1]);
 		kill(child, SIGTERM);
 	} else {
 		close(fd[1]);
 		if (wait_server)
-			client(fd[0]);
+			client(fd[0], 32);
 		else
-			server(fd[0], server_packet);
+			server(fd[0], server_packet, 32);
 		close(fd[0]);
 		exit(0);
 	}


More information about the Gnutls-devel mailing list