[PATCH 3/3] resolv: Handle transaction ID collisions in parallel queries (bug 26600)

Florian Weimer fweimer@redhat.com
Wed Oct 14 17:57:35 GMT 2020


* Stefan Liebler via Libc-alpha:

> On 10/13/20 8:18 PM, Siddhesh Poyarekar wrote:
>> On 9/11/20 6:35 PM, Florian Weimer via Libc-alpha wrote:
> ...
>> 
>> Test is also OK.
>> 
>> Looks good to me.
>> 
>> Thanks,
>> Siddhesh
>> 
> Hi Florian,
>
> I've recognized a test-fail for the new test
> resolv/tst-resolv-txnid-collision (of course on s390x):
> tst-resolv-txnid-collision.c:166: numeric comparison failure
>    left: 0 (0x0); from: ctx->server_index
>   right: 1 (0x1); from: previous_server_index
> error: tst-resolv-txnid-collision.c:167: not true: previous_qtype != qtype
> error: 2 test failures
> (See attached tst-resolv-txnid-collision_20201014_174129_4983.log)
>
> So far, I've just run the test resolv/tst-resolv-txnid-collision with
> --direct --verbose in a loop and collected the output (see attachements).

Well, this is embarrassing.  I will have to make the test more tolerant
of packet reordering.  Thanks for reporting this, I can (somewhat
rarely) reproduce this, on an s390x system (under high load, I think).

> It also happens that the test segfaults.
> Here is one backtrace (also see attached
> tst-resolv-txnid-collision_20201014_174533_4318.log):
> (gdb) bt full
> #0  0x0000000001001c28 in resolv_response_context_free (ctx=0x0) at
> resolv_response_context_free.c:25
> No locals.
> #1  0x00000000010017cc in response (ctx=0x3fffcf7cab8, b=0x3ffec000b60,
> qname=0x3fffcf7cb72 "reorder-1-0.rcode-2.example.net",
>     qclass=<optimized out>, qtype=<optimized out>) at
> tst-resolv-txnid-collision.c:204
>         parsed = {rcode = 2, reorder = {true, false}}

This should fix the crash at least, it's a concurrency bug in the test:

diff --git a/resolv/tst-resolv-txnid-collision.c b/resolv/tst-resolv-txnid-collision.c
index 611d3736..db9a52b6 100644
--- a/resolv/tst-resolv-txnid-collision.c
+++ b/resolv/tst-resolv-txnid-collision.c
@@ -309,6 +309,7 @@ do_test (void)
     ((struct resolv_redirect_config)
      {
        .response_callback = response,
+       .single_thread_udp = true,
      });
 
   for (int rcode = 0; rcode <= 5; ++rcode)

I doubt it will fix the other test failure, but I'm going to run the
test over night with this test.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill



More information about the Libc-alpha mailing list