<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><br>
</p>
<div class="moz-cite-prefix">On 04/12/2017 06:31 PM, Vitaly Buka
wrote:<br>
</div>
<blockquote
cite="mid:CAPjTjwuOpmxfAtgvdKApERbq=B=XgFjLnvU=QdY-=+=a2qzXag@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<div dir="ltr">Does this fail on just before? E.g. on r299883
<div>It's weird that it fails <span style="color:rgb(33,33,33)">IpTests/MemorySanitizerIpTest.</span><span
style="color:rgb(33,33,33)">accept/<b>0</b> which suppose to
be IPv4 as before.</span></div>
</div>
</blockquote>
<br>
Both the /0 test which fail, and the /1 tests which fail, say where
GetParam() = 10. The 10 is AF_INET6 (it would say 2 for AF_INET). So
it is just the IPv6 tests that are failing.<br>
<br>
Heh; actually, I think the problem here is the code:<br>
<br>
for (int i : std::vector<int>(AF_INET, AF_INET6)) {<br>
int s = socket(i, SOCK_STREAM, 0);<br>
if (s > 0) {<br>
result.push_back(i);<br>
close(s);<br>
}<br>
}<br>
<br>
std::vector<int>(AF_INET, AF_INET6) creates a vector of size 2
(because AF_INET == 2) where each element is initialized to
AF_INET6. This is not what you intended.<br>
<br>
Also, it seems that the systems in my build cluster don't have valid
IPv6 loopback addresses. I did some quick tests and a bind on an
IPv6 socket succeeds with in6addr_any but fails with
in6addr_loopback. I suppose this makes sense because the lo
interface does not seem to have an IPv6 address:<br>
<br>
$ ifconfig lo<br>
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536<br>
inet 127.0.0.1 netmask 255.255.255.0<br>
loop txqueuelen 1 (Local Loopback)<br>
RX packets ...<br>
<br>
I suspect this explains why the IPv6 tests, which want to bind to
in6addr_loopback, fail.<br>
<br>
Thanks again,<br>
Hal<br>
<br>
<blockquote
cite="mid:CAPjTjwuOpmxfAtgvdKApERbq=B=XgFjLnvU=QdY-=+=a2qzXag@mail.gmail.com"
type="cite"><br>
<div class="gmail_quote">
<div dir="ltr">On Wed, Apr 12, 2017 at 4:22 PM Vitaly Buka <<a
moz-do-not-send="true" href="mailto:vitalybuka@google.com">vitalybuka@google.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" class="gmail_msg">Oh, my mistake squashing
local git commits.
<div class="gmail_msg">This CL reverts nothing.</div>
</div>
<br class="gmail_msg">
<div class="gmail_quote gmail_msg">
<div dir="ltr" class="gmail_msg">On Wed, Apr 12, 2017 at
4:07 PM Hal Finkel <<a moz-do-not-send="true"
href="mailto:hfinkel@anl.gov" class="gmail_msg"
target="_blank">hfinkel@anl.gov</a>> wrote:<br
class="gmail_msg">
</div>
<blockquote class="gmail_quote gmail_msg" style="margin:0 0
0 .8ex;border-left:1px #ccc solid;padding-left:1ex">FYI:
This is failing on my build cluster. I see output like
this:<br class="gmail_msg">
<br class="gmail_msg">
[ RUN ] IpTests/MemorySanitizerIpTest.accept/0<br
class="gmail_msg">
/home/hfinkel/public/src/llvm/projects/compiler-rt/lib/msan/tests/msan_test.cc:972:<br
class="gmail_msg">
Failure<br class="gmail_msg">
Expected: 0<br class="gmail_msg">
To be equal to: res<br class="gmail_msg">
Which is: -1<br class="gmail_msg">
[ FAILED ] IpTests/MemorySanitizerIpTest.accept/0, where
GetParam() =<br class="gmail_msg">
10 (3 ms)<br class="gmail_msg">
<br class="gmail_msg">
...<br class="gmail_msg">
<br class="gmail_msg">
MemorySanitizer-Unit ::<br class="gmail_msg">
Msan-x86_64-Test/IpTests/MemorySanitizerIpTest.accept/0<br
class="gmail_msg">
MemorySanitizer-Unit ::<br class="gmail_msg">
Msan-x86_64-Test/IpTests/MemorySanitizerIpTest.accept/1<br
class="gmail_msg">
MemorySanitizer-Unit ::<br class="gmail_msg">
Msan-x86_64-Test/IpTests/MemorySanitizerIpTest.recvmsg/0<br
class="gmail_msg">
MemorySanitizer-Unit ::<br class="gmail_msg">
Msan-x86_64-Test/IpTests/MemorySanitizerIpTest.recvmsg/1<br
class="gmail_msg">
MemorySanitizer-Unit ::<br class="gmail_msg">
Msan-x86_64-with-call-Test/IpTests/MemorySanitizerIpTest.accept/0<br
class="gmail_msg">
MemorySanitizer-Unit ::<br class="gmail_msg">
Msan-x86_64-with-call-Test/IpTests/MemorySanitizerIpTest.accept/1<br
class="gmail_msg">
MemorySanitizer-Unit ::<br class="gmail_msg">
Msan-x86_64-with-call-Test/IpTests/MemorySanitizerIpTest.recvmsg/0<br
class="gmail_msg">
MemorySanitizer-Unit ::<br class="gmail_msg">
Msan-x86_64-with-call-Test/IpTests/MemorySanitizerIpTest.recvmsg/1<br
class="gmail_msg">
<br class="gmail_msg">
The call to bind() is failing (i.e. returning -1).<br
class="gmail_msg">
<br class="gmail_msg">
On 04/10/2017 04:03 PM, Vitaly Buka via llvm-commits
wrote:<br class="gmail_msg">
> Author: vitalybuka<br class="gmail_msg">
> Date: Mon Apr 10 16:03:18 2017<br class="gmail_msg">
> New Revision: 299884<br class="gmail_msg">
><br class="gmail_msg">
> URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project?rev=299884&view=rev"
rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=299884&view=rev</a><br
class="gmail_msg">
> Log:<br class="gmail_msg">
> [msan] Choose in runtime if IPv4 or IPv6 are
supported.<br class="gmail_msg">
><br class="gmail_msg">
> Summary: This reverts commit
cab5051c691ce27a7ffac41e8e76ceb222ad9549.<br
class="gmail_msg">
<br class="gmail_msg">
Which commit is this?<br class="gmail_msg">
<br class="gmail_msg">
-Hal<br class="gmail_msg">
<br class="gmail_msg">
><br class="gmail_msg">
> Reviewers: eugenis<br class="gmail_msg">
><br class="gmail_msg">
> Subscribers: mgorny, llvm-commits<br
class="gmail_msg">
><br class="gmail_msg">
> Differential Revision: <a moz-do-not-send="true"
href="https://reviews.llvm.org/D31894" rel="noreferrer"
class="gmail_msg" target="_blank">https://reviews.llvm.org/D31894</a><br
class="gmail_msg">
><br class="gmail_msg">
> Modified:<br class="gmail_msg">
> compiler-rt/trunk/lib/msan/tests/CMakeLists.txt<br
class="gmail_msg">
> compiler-rt/trunk/lib/msan/tests/msan_test.cc<br
class="gmail_msg">
><br class="gmail_msg">
> Modified:
compiler-rt/trunk/lib/msan/tests/CMakeLists.txt<br
class="gmail_msg">
> URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/CMakeLists.txt?rev=299884&r1=299883&r2=299884&view=diff"
rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/CMakeLists.txt?rev=299884&r1=299883&r2=299884&view=diff</a><br
class="gmail_msg">
>
==============================================================================<br
class="gmail_msg">
> --- compiler-rt/trunk/lib/msan/tests/CMakeLists.txt
(original)<br class="gmail_msg">
> +++ compiler-rt/trunk/lib/msan/tests/CMakeLists.txt
Mon Apr 10 16:03:18 2017<br class="gmail_msg">
> @@ -35,6 +35,7 @@ set(MSAN_UNITTEST_COMMON_CFLAGS<br
class="gmail_msg">
> -Wno-zero-length-array<br class="gmail_msg">
> -Wno-uninitialized<br class="gmail_msg">
> -Werror=sign-compare<br class="gmail_msg">
> + -Wno-gnu-zero-variadic-macro-arguments<br
class="gmail_msg">
> )<br class="gmail_msg">
> set(MSAN_UNITTEST_INSTRUMENTED_CFLAGS<br
class="gmail_msg">
> ${MSAN_UNITTEST_COMMON_CFLAGS}<br
class="gmail_msg">
><br class="gmail_msg">
> Modified:
compiler-rt/trunk/lib/msan/tests/msan_test.cc<br
class="gmail_msg">
> URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/msan_test.cc?rev=299884&r1=299883&r2=299884&view=diff"
rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/msan_test.cc?rev=299884&r1=299883&r2=299884&view=diff</a><br
class="gmail_msg">
>
==============================================================================<br
class="gmail_msg">
> --- compiler-rt/trunk/lib/msan/tests/msan_test.cc
(original)<br class="gmail_msg">
> +++ compiler-rt/trunk/lib/msan/tests/msan_test.cc Mon
Apr 10 16:03:18 2017<br class="gmail_msg">
> @@ -902,9 +902,7 @@ class SocketAddr4 : public
SocketAddr {<br class="gmail_msg">
> sai_.sin_addr.s_addr = htonl(INADDR_LOOPBACK);<br
class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> - sockaddr *ptr() override {<br class="gmail_msg">
> - return reinterpret_cast<sockaddr
*>(&sai_);<br class="gmail_msg">
> - }<br class="gmail_msg">
> + sockaddr *ptr() override { return
reinterpret_cast<sockaddr *>(&sai_); }<br
class="gmail_msg">
><br class="gmail_msg">
> size_t size() const override { return
sizeof(sai_); }<br class="gmail_msg">
><br class="gmail_msg">
> @@ -912,14 +910,60 @@ class SocketAddr4 : public
SocketAddr {<br class="gmail_msg">
> sockaddr_in sai_;<br class="gmail_msg">
> };<br class="gmail_msg">
><br class="gmail_msg">
> -template <class... Args><br class="gmail_msg">
> -std::unique_ptr<SocketAddr>
CreateSockAddr(Args... args) {<br class="gmail_msg">
> - return std::unique_ptr<SocketAddr>(new
SocketAddr4(args...));<br class="gmail_msg">
> +class SocketAddr6 : public SocketAddr {<br
class="gmail_msg">
> + public:<br class="gmail_msg">
> + SocketAddr6() { EXPECT_POISONED(sai_); }<br
class="gmail_msg">
> + explicit SocketAddr6(uint16_t port) {<br
class="gmail_msg">
> + memset(&sai_, 0, sizeof(sai_));<br
class="gmail_msg">
> + sai_.sin6_family = AF_INET6;<br
class="gmail_msg">
> + sai_.sin6_port = port;<br class="gmail_msg">
> + sai_.sin6_addr = in6addr_loopback;<br
class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + sockaddr *ptr() override { return
reinterpret_cast<sockaddr *>(&sai_); }<br
class="gmail_msg">
> +<br class="gmail_msg">
> + size_t size() const override { return
sizeof(sai_); }<br class="gmail_msg">
> +<br class="gmail_msg">
> + private:<br class="gmail_msg">
> + sockaddr_in6 sai_;<br class="gmail_msg">
> +};<br class="gmail_msg">
> +<br class="gmail_msg">
> +class MemorySanitizerIpTest : public
::testing::TestWithParam<int> {<br class="gmail_msg">
> + public:<br class="gmail_msg">
> + void SetUp() override {<br class="gmail_msg">
> + ASSERT_TRUE(GetParam() == AF_INET || GetParam()
== AF_INET6);<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + template <class... Args><br
class="gmail_msg">
> + std::unique_ptr<SocketAddr>
CreateSockAddr(Args... args) const {<br class="gmail_msg">
> + if (GetParam() == AF_INET)<br class="gmail_msg">
> + return std::unique_ptr<SocketAddr>(new
SocketAddr4(args...));<br class="gmail_msg">
> + return std::unique_ptr<SocketAddr>(new
SocketAddr6(args...));<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + int CreateSocket(int socket_type) const {<br
class="gmail_msg">
> + return socket(GetParam(), socket_type, 0);<br
class="gmail_msg">
> + }<br class="gmail_msg">
> +};<br class="gmail_msg">
> +<br class="gmail_msg">
> +std::vector<int>
GetAvailableIpSocketFamilies() {<br class="gmail_msg">
> + std::vector<int> result;<br
class="gmail_msg">
> +<br class="gmail_msg">
> + for (int i : std::vector<int>(AF_INET,
AF_INET6)) {<br class="gmail_msg">
> + int s = socket(i, SOCK_STREAM, 0);<br
class="gmail_msg">
> + if (s > 0) {<br class="gmail_msg">
> + result.push_back(i);<br class="gmail_msg">
> + close(s);<br class="gmail_msg">
> + }<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + return result;<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> -int CreateSocket(int socket_type) { return
socket(AF_INET, socket_type, 0); }<br class="gmail_msg">
> +INSTANTIATE_TEST_CASE_P(IpTests,
MemorySanitizerIpTest,<br class="gmail_msg">
> +
::testing::ValuesIn(GetAvailableIpSocketFamilies()));<br
class="gmail_msg">
><br class="gmail_msg">
> -TEST(MemorySanitizer, accept) {<br class="gmail_msg">
> +TEST_P(MemorySanitizerIpTest, accept) {<br
class="gmail_msg">
> int listen_socket = CreateSocket(SOCK_STREAM);<br
class="gmail_msg">
> ASSERT_LT(0, listen_socket);<br class="gmail_msg">
><br class="gmail_msg">
> @@ -963,7 +1007,7 @@ TEST(MemorySanitizer, accept) {<br
class="gmail_msg">
> close(listen_socket);<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> -TEST(MemorySanitizer, recvmsg) {<br
class="gmail_msg">
> +TEST_P(MemorySanitizerIpTest, recvmsg) {<br
class="gmail_msg">
> int server_socket = CreateSocket(SOCK_DGRAM);<br
class="gmail_msg">
> ASSERT_LT(0, server_socket);<br class="gmail_msg">
><br class="gmail_msg">
><br class="gmail_msg">
><br class="gmail_msg">
> _______________________________________________<br
class="gmail_msg">
> llvm-commits mailing list<br class="gmail_msg">
> <a moz-do-not-send="true"
href="mailto:llvm-commits@lists.llvm.org"
class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a><br
class="gmail_msg">
> <a moz-do-not-send="true"
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits"
rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br
class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Hal Finkel<br class="gmail_msg">
Lead, Compiler Technology and Programming Languages<br
class="gmail_msg">
Leadership Computing Facility<br class="gmail_msg">
Argonne National Laboratory<br class="gmail_msg">
<br class="gmail_msg">
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</body>
</html>