changeset 1101:78cb8e66b6bc

Tests: skipped the whole http_resolver_cleanup.t where appropriate. While here, explained use-after-free issue in a bit more detail.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 20 Dec 2016 12:56:54 +0300
parents 52553ea2171c
children 89d7d4d1be40
files http_resolver_cleanup.t
diffstat 1 files changed, 10 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/http_resolver_cleanup.t
+++ b/http_resolver_cleanup.t
@@ -22,9 +22,13 @@ use Test::Nginx;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(1);
+my $t = Test::Nginx->new()->has(qw/http proxy/);
 
-$t->write_file_expand('nginx.conf', <<'EOF');
+plan(skip_all => 'win32') if $^O eq 'MSWin32';
+plan(skip_all => 'use-after-free on shutdown') unless $ENV{TEST_NGINX_UNSAFE}
+	or $t->has_version('1.11.8');
+
+$t->write_file_expand('nginx.conf', <<'EOF')->plan(1);
 
 %%TEST_GLOBALS%%
 
@@ -58,23 +62,17 @@ EOF
 
 ###############################################################################
 
-my ($s);
-
-TODO: {
-todo_skip 'use-after-free', 1 unless $ENV{TEST_NGINX_UNSAFE}
-	or $t->has_version('1.11.8');
-
 # truncated UDP response, no response over TCP
 
-$s = http_get('/', start => 1);
+my $s = http_get('/', start => 1);
 
 pass('request');
 
 sleep 1;
 
-}
-
-# use-after-free in worker on fast shutdown
+# retrasmission timer wasn't removed during resolver cleanup,
+# while the event memory was freed, resulting in use-after-free
+# when later removing timer in TCP connection
 
 http_get('/pid') =~ qr/X-Pid: (\d+)/;
 kill 'TERM', $1;