<div dir="ltr">Ugh, it should be <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">PATH_MAX everywhere. I'll update.</span><br><div><br></div><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 31, 2018 at 4:44 PM, Kuba Mracek <span dir="ltr"><<a href="mailto:mracek@apple.com" class="m_5526518756143373610cremed cremed" target="_blank">mracek@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Vitaly,<br>
<br>
NAME_MAX is 255 on Darwin and this actually overflows on one of out bot machines, where the directory name is longer than that :)<br>
<br>
Can you switch back to PATH_MAX?<br>
<span class="m_5526518756143373610m_1688029454649497332HOEnZb"><font color="#888888"><br>
Kuba<br>
</font></span><div class="m_5526518756143373610m_1688029454649497332HOEnZb"><div class="m_5526518756143373610m_1688029454649497332h5"><br>
> On Jan 30, 2018, at 3:51 PM, Vitaly Buka via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="m_5526518756143373610cremed cremed" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
><br>
> Author: vitalybuka<br>
> Date: Tue Jan 30 15:51:44 2018<br>
> New Revision: 323834<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=323834&view=rev" rel="noreferrer" class="m_5526518756143373610cremed cremed" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=323834&view=rev</a><br>
> Log:<br>
> [sanitizer] Fix tests on Android and Darwin<br>
><br>
> Modified:<br>
>    compiler-rt/trunk/lib/sanitize<wbr>r_common/sanitizer_platform_in<wbr>terceptors.h<br>
>    compiler-rt/trunk/test/sanitiz<wbr>er_common/TestCases/Linux/name<wbr>_to_handle_at.cc<br>
>    compiler-rt/trunk/test/sanitiz<wbr>er_common/TestCases/Linux/read<wbr>linkat.c<br>
>    compiler-rt/trunk/test/sanitiz<wbr>er_common/TestCases/Posix/read<wbr>link.c<br>
><br>
> Modified: compiler-rt/trunk/lib/sanitize<wbr>r_common/sanitizer_platform_in<wbr>terceptors.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h?rev=323834&r1=323833&r2=323834&view=diff" rel="noreferrer" class="m_5526518756143373610cremed cremed" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/compiler-rt/trunk/lib/sa<wbr>nitizer_common/sanitizer_platf<wbr>orm_interceptors.h?rev=323834&<wbr>r1=323833&r2=323834&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- compiler-rt/trunk/lib/sanitize<wbr>r_common/sanitizer_platform_in<wbr>terceptors.h (original)<br>
> +++ compiler-rt/trunk/lib/sanitize<wbr>r_common/sanitizer_platform_in<wbr>terceptors.h Tue Jan 30 15:51:44 2018<br>
> @@ -442,10 +442,17 @@<br>
> #define SANITIZER_INTERCEPT_FACCESSAT SI_NETBSD<br>
> #define SANITIZER_INTERCEPT_GETGROUPLI<wbr>ST SI_NETBSD<br>
><br>
> -#define SANITIZER_INTERCEPT_NAME_TO_HA<wbr>NDLE_AT SI_LINUX<br>
> -#define SANITIZER_INTERCEPT_OPEN_BY_HA<wbr>NDLE_AT SI_LINUX<br>
> +#define SANITIZER_INTERCEPT_NAME_TO_HA<wbr>NDLE_AT SI_LINUX_NOT_ANDROID<br>
> +#define SANITIZER_INTERCEPT_OPEN_BY_HA<wbr>NDLE_AT SI_LINUX_NOT_ANDROID<br>
><br>
> #define SANITIZER_INTERCEPT_READLINK SI_POSIX<br>
> -#define SANITIZER_INTERCEPT_READLINKAT SI_POSIX<br>
> +#if defined(__ENVIRONMENT_MAC_OS_X<wbr>_VERSION_MIN_REQUIRED__) && \<br>
> +    __ENVIRONMENT_MAC_OS_X_VERSION<wbr>_MIN_REQUIRED__ < 101000<br>
> +# define SI_MAC_DEPLOYMENT_BELOW_10_10 1<br>
> +#else<br>
> +# define SI_MAC_DEPLOYMENT_BELOW_10_10 0<br>
> +#endif<br>
> +#define SANITIZER_INTERCEPT_READLINKAT \<br>
> +  (SI_POSIX && !SI_MAC_DEPLOYMENT_BELOW_10_10<wbr>)<br>
><br>
> #endif  // #ifndef SANITIZER_PLATFORM_INTERCEPTOR<wbr>S_H<br>
><br>
> Modified: compiler-rt/trunk/test/sanitiz<wbr>er_common/TestCases/Linux/name<wbr>_to_handle_at.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/name_to_handle_at.cc?rev=323834&r1=323833&r2=323834&view=diff" rel="noreferrer" class="m_5526518756143373610cremed cremed" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/compiler-rt/trunk/test/s<wbr>anitizer_common/TestCases/Linu<wbr>x/name_to_handle_at.cc?rev=<wbr>323834&r1=323833&r2=323834&<wbr>view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- compiler-rt/trunk/test/sanitiz<wbr>er_common/TestCases/Linux/name<wbr>_to_handle_at.cc (original)<br>
> +++ compiler-rt/trunk/test/sanitiz<wbr>er_common/TestCases/Linux/name<wbr>_to_handle_at.cc Tue Jan 30 15:51:44 2018<br>
> @@ -1,4 +1,5 @@<br>
> // RUN: %clangxx -O0 %s -o %t && %run %t<br>
> +// UNSUPPORTED: android<br>
><br>
> #include <assert.h><br>
> #include <fcntl.h><br>
><br>
> Modified: compiler-rt/trunk/test/sanitiz<wbr>er_common/TestCases/Linux/read<wbr>linkat.c<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/readlinkat.c?rev=323834&r1=323833&r2=323834&view=diff" rel="noreferrer" class="m_5526518756143373610cremed cremed" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/compiler-rt/trunk/test/s<wbr>anitizer_common/TestCases/Linu<wbr>x/readlinkat.c?rev=323834&r1=<wbr>323833&r2=323834&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- compiler-rt/trunk/test/sanitiz<wbr>er_common/TestCases/Linux/read<wbr>linkat.c (original)<br>
> +++ compiler-rt/trunk/test/sanitiz<wbr>er_common/TestCases/Linux/read<wbr>linkat.c Tue Jan 30 15:51:44 2018<br>
> @@ -2,19 +2,19 @@<br>
><br>
> #include <assert.h><br>
> #include <fcntl.h><br>
> -#include <linux/limits.h><br>
> +#include <limits.h><br>
> #include <stdio.h><br>
> #include <string.h><br>
> #include <unistd.h><br>
><br>
> int main(int argc, char **argv) {<br>
> -  char symlink_path[PATH_MAX];<br>
> +  char symlink_path[NAME_MAX];<br>
>   snprintf(symlink_path, sizeof(symlink_path), "%s_%d.symlink", argv[0],<br>
>            getpid());<br>
>   int res = symlink(argv[0], symlink_path);<br>
>   assert(!res);<br>
><br>
> -  char readlinkat_path[PATH_MAX];<br>
> +  char readlinkat_path[NAME_MAX];<br>
>   int res2 = readlinkat(AT_FDCWD, symlink_path, readlinkat_path,<br>
>                         sizeof(readlinkat_path));<br>
>   assert(res2 >= 0);<br>
><br>
> Modified: compiler-rt/trunk/test/sanitiz<wbr>er_common/TestCases/Posix/read<wbr>link.c<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/readlink.c?rev=323834&r1=323833&r2=323834&view=diff" rel="noreferrer" class="m_5526518756143373610cremed cremed" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/compiler-rt/trunk/test/s<wbr>anitizer_common/TestCases/Posi<wbr>x/readlink.c?rev=323834&r1=<wbr>323833&r2=323834&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- compiler-rt/trunk/test/sanitiz<wbr>er_common/TestCases/Posix/read<wbr>link.c (original)<br>
> +++ compiler-rt/trunk/test/sanitiz<wbr>er_common/TestCases/Posix/read<wbr>link.c Tue Jan 30 15:51:44 2018<br>
> @@ -2,26 +2,26 @@<br>
><br>
> #include <assert.h><br>
> #include <fcntl.h><br>
> -#include <linux/limits.h><br>
> +#include <limits.h><br>
> #include <stdio.h><br>
> #include <string.h><br>
> #include <sys/types.h><br>
> #include <unistd.h><br>
><br>
> int main(int argc, char **argv) {<br>
> -  char symlink_path[PATH_MAX];<br>
> +  char symlink_path[NAME_MAX];<br>
>   snprintf(symlink_path, sizeof(symlink_path), "%s_%d.symlink", argv[0],<br>
>            getpid());<br>
>   int res = symlink(argv[0], symlink_path);<br>
>   assert(!res);<br>
><br>
> -  char readlink_path[PATH_MAX];<br>
> +  char readlink_path[NAME_MAX];<br>
>   ssize_t res2 = readlink(symlink_path, readlink_path, sizeof(readlink_path));<br>
>   assert(res2 >= 0);<br>
>   readlink_path[res2] = '\0';<br>
>   assert(!strcmp(readlink_path, argv[0]));<br>
><br>
> -  char readlinkat_path[PATH_MAX];<br>
> +  char readlinkat_path[NAME_MAX];<br>
>   res2 = readlinkat(AT_FDCWD, symlink_path, readlinkat_path,<br>
>                     sizeof(readlink_path));<br>
>   assert(res2 >= 0);<br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org" class="m_5526518756143373610cremed cremed" target="_blank">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="m_5526518756143373610cremed cremed" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
<br>
</div></div></blockquote></div><br></div></div>