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

Dmitri Gribenko gribozavr at gmail.com
Sat Feb 16 12:10:52 PST 2013


On Sat, Feb 9, 2013 at 7:32 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> 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.

Alexey,

This does actually happen, for example on my buildbot.  The build runs
from a different user, and it created the temporary file first.  Now
this test fails under my normal user.

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