[compiler-rt] r300150 - [msan] Fix msan_test broken after r299884.

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 11:20:25 PDT 2017


Thanks, I'll update the test.

On Thu, Apr 13, 2017 at 6:55 AM Hal Finkel <hfinkel at anl.gov> wrote:

> Hi Vitaly,
>
> With further testing, I recommend that you revert this. It does not
> actually solve the problem. In short, I now see this failure mode:
>
>      MemorySanitizer-Unit ::
> Msan-x86_64-Test/IpTests/MemorySanitizerIpTest.accept/1
>      MemorySanitizer-Unit ::
> Msan-x86_64-Test/IpTests/MemorySanitizerIpTest.recvmsg/1
>      MemorySanitizer-Unit ::
> Msan-x86_64-with-call-Test/IpTests/MemorySanitizerIpTest.accept/1
>      MemorySanitizer-Unit ::
> Msan-x86_64-with-call-Test/IpTests/MemorySanitizerIpTest.recvmsg/1
>
> [ RUN      ] IpTests/MemorySanitizerIpTest.accept/1
>
> /home/hfinkel/public/src/llvm/projects/compiler-rt/lib/msan/tests/msan_test.cc:990:
> Failure
>        Expected: 115
> To be equal to: (*__errno_location ())
>        Which is: 113
> [  FAILED  ] IpTests/MemorySanitizerIpTest.accept/1, where GetParam() =
> 10 (4 ms)
> [----------] 1 test from IpTests/MemorySanitizerIpTest (4 ms total)
>
> Meaning that, instead of returning EINPROGRESS, it returns EHOSTUNREACH
> (which is consistent with the lack of IPv6 on the interfaces).
>
> ...
>
> [ RUN      ] IpTests/MemorySanitizerIpTest.recvmsg/1
>
> /home/hfinkel/public/src/llvm/projects/compiler-rt/lib/msan/tests/msan_test.cc:1046:
> Failure
> Expected: (0) < (res), actual: 0 vs -1
> [  FAILED  ] IpTests/MemorySanitizerIpTest.recvmsg/1, where GetParam() =
> 10 (4 ms)
> [----------] 1 test from IpTests/MemorySanitizerIpTest (4 ms total)
>
> ...
>
> (i.e. sendmsg did not actually send any data - we don't report errno in
> this case).
>
> Instead of making the tests robust to all of the ways that the socket
> calls might fail on a system that does not actually have IPv6 configured
> (even if the kernel supports it), I suggest just asking for the loopback
> interface and then dealing with the fact that the bind call might fail.
> On my system, binding to the loopback when it has no IPv6 assignment
> sets errno to EADDRNOTAVAIL.
>
> Thanks again,
> Hal
>
> On 04/12/2017 07:36 PM, Vitaly Buka via llvm-commits wrote:
> > Author: vitalybuka
> > Date: Wed Apr 12 19:36:03 2017
> > New Revision: 300150
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=300150&view=rev
> > Log:
> > [msan] Fix msan_test broken after r299884.
> >
> > Bind to ANY as some machines may have IPv6 support but without IPv6 on
> loopback
> > interface.
> >
> > Reviewers: eugenis
> >
> > Subscribers: llvm-commits
> >
> > Differential Revision: https://reviews.llvm.org/D31998
> >
> > Modified:
> >      compiler-rt/trunk/lib/msan/tests/msan_test.cc
> >
> > Modified: compiler-rt/trunk/lib/msan/tests/msan_test.cc
> > URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/msan_test.cc?rev=300150&r1=300149&r2=300150&view=diff
> >
> ==============================================================================
> > --- compiler-rt/trunk/lib/msan/tests/msan_test.cc (original)
> > +++ compiler-rt/trunk/lib/msan/tests/msan_test.cc Wed Apr 12 19:36:03
> 2017
> > @@ -899,7 +899,7 @@ class SocketAddr4 : public SocketAddr {
> >       memset(&sai_, 0, sizeof(sai_));
> >       sai_.sin_family = AF_INET;
> >       sai_.sin_port = port;
> > -    sai_.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
> > +    sai_.sin_addr.s_addr = htonl(INADDR_ANY);
> >     }
> >
> >     sockaddr *ptr() override { return reinterpret_cast<sockaddr
> *>(&sai_); }
> > @@ -917,7 +917,7 @@ class SocketAddr6 : public SocketAddr {
> >       memset(&sai_, 0, sizeof(sai_));
> >       sai_.sin6_family = AF_INET6;
> >       sai_.sin6_port = port;
> > -    sai_.sin6_addr = in6addr_loopback;
> > +    sai_.sin6_addr = in6addr_any;
> >     }
> >
> >     sockaddr *ptr() override { return reinterpret_cast<sockaddr
> *>(&sai_); }
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
> --
> Hal Finkel
> Lead, Compiler Technology and Programming Languages
> Leadership Computing Facility
> Argonne National Laboratory
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170413/cbd5ef8b/attachment.html>


More information about the llvm-commits mailing list