Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Can you move tests into Linux. Tests should be trivially ported to Linux. if you don't like to guess Linux changes just put temporarily "REQUIRES: !freebsd", and someone, maybe me, will update tests. Or I can test you changes.
So far I see:
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h @@ -521,7 +521,7 @@ #define SANITIZER_INTERCEPT_TTYENT SI_NETBSD #define SANITIZER_INTERCEPT_PROTOENT (SI_NETBSD || SI_LINUX || SI_FREEBSD) #define SANITIZER_INTERCEPT_PROTOENT_R SI_GLIBC -#define SANITIZER_INTERCEPT_NETENT (SI_NETBSD || SI_FREEBSD) +#define SANITIZER_INTERCEPT_NETENT (SI_NETBSD || SI_LINUX || SI_FREEBSD) #define SANITIZER_INTERCEPT_SETVBUF \ (SI_NETBSD || SI_FREEBSD || SI_LINUX || SI_MAC) #define SANITIZER_INTERCEPT_GETMNTINFO (SI_NETBSD || SI_FREEBSD || SI_MAC) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h index 5657f33dc66a..d69b344dd613 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h @@ -715,6 +715,13 @@ struct __sanitizer_protoent { int p_proto; }; +struct __sanitizer_netent { + char *n_name; + char **n_aliases; + int n_addrtype; + u32 n_net; +}; +
compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h | ||
---|---|---|
449–450 | please clang format as it asks | |
compiler-rt/test/sanitizer_common/TestCases/FreeBSD/netent.cpp | ||
3 ↗ | (On Diff #370784) | up to you, but assert() looks simpler than printf and FileChecks here |
compiler-rt/test/sanitizer_common/TestCases/FreeBSD/protoent.cpp | ||
22 ↗ | (On Diff #370784) | this makes some assumption about buildbot network setup or probably assume getnetbyaddr may return null |
compiler-rt/test/sanitizer_common/TestCases/FreeBSD/netent.cpp | ||
---|---|---|
40 ↗ | (On Diff #370784) | It can't find like this on my system, but this works struct netent *lb = getnetbyname("loopback"); struct netent *ntp = getnetbyaddr(lb->n_net, lb->n_addrtype); |
76 ↗ | (On Diff #370784) | I get here: netent |
compiler-rt/test/sanitizer_common/TestCases/FreeBSD/protoent.cpp | ||
---|---|---|
22 ↗ | (On Diff #370784) | loopback is linux denomination, for freebsd it is your-net but I ll follow your advices using assert and correcting these naming. |
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h | ||
---|---|---|
416 | It would be nice to clang-format the file in a separate patch. | |
compiler-rt/test/sanitizer_common/TestCases/FreeBSD/protoent.cpp | ||
3 ↗ | (On Diff #371720) | I expected you are going to move this one into Linux as well, we already intercept getprotoent |
compiler-rt/test/sanitizer_common/TestCases/Linux/netent.cpp | ||
4 | getnetent is not intercepted on Linux, so it fails msan |
compiler-rt/test/sanitizer_common/TestCases/FreeBSD/protoent.cpp | ||
---|---|---|
3 ↗ | (On Diff #371720) | well I hesitated because as you said it s already intercepted and also has an existing test but no problems I can move this. |
compiler-rt/test/sanitizer_common/TestCases/Linux/netent.cpp | ||
---|---|---|
4 | Yes going for make linux intercepting, worth the little effort |
please clang format as it asks