[asan] Revert r201402, r201404.
[blocksruntime.git] / lib / msan / lit_tests / getaddrinfo.cc
blob0518cf4733d0f2cd818f2127d82f39cd1fe34242
1 // RUN: %clangxx_msan -m64 -O0 %s -o %t && %t
3 #include <sys/types.h>
4 #include <sys/socket.h>
5 #include <netdb.h>
6 #include <stdlib.h>
8 void poison_stack_ahead() {
9 char buf[100000];
10 // With -O0 this poisons a large chunk of stack.
13 int main(void) {
14 poison_stack_ahead();
16 struct addrinfo *ai;
18 // This should trigger loading of libnss_dns and friends.
19 // Those libraries are typically uninstrumented.They will call strlen() on a
20 // stack-allocated buffer, which is very likely to be poisoned. Test that we
21 // don't report this as an UMR.
22 int res = getaddrinfo("not-in-etc-hosts", NULL, NULL, &ai);
23 return 0;