[compiler-rt] r174316 - [Sanitizer] extend internal libc with stat/fstat/lstat functions

Dmitri Gribenko gribozavr at gmail.com
Sat Feb 9 09:32:14 PST 2013


Hello Alexey,

On Mon, Feb 4, 2013 at 12:16 PM, Alexey Samsonov <samsonov at google.com> wrote:
> +TEST(SanitizerCommon, FileOps) {
> +  const char *str1 = "qwerty";
> +  uptr len1 = internal_strlen(str1);
> +  const char *str2 = "zxcv";
> +  uptr len2 = internal_strlen(str2);
> +
> +  const char kTempFileName[] = "/tmp/sanitizer_common.tmp";
> +  fd_t fd = OpenFile(kTempFileName, true);

This test fails if the file already exists and the user doesn't have
enough permissions to open it.  This can trivially happen on a
multi-user machine.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the llvm-commits mailing list