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

Dmitri Gribenko gribozavr at gmail.com
Mon Feb 18 06:14:14 PST 2013


On Mon, Feb 18, 2013 at 9:18 AM, Alexey Samsonov <samsonov at google.com> wrote:
>
> On Sun, Feb 17, 2013 at 12:10 AM, Dmitri Gribenko <gribozavr at gmail.com>
> wrote:
>>
>> 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.
>
>
> Yes, sorry for fixing this that slowly...
> I think r175424 should help.

Thank you, it fixed the issue.  The fix is interesting -- I expected
that you would just append a random string to the file name (or call
mktemp()) -- but probably sanitizer tests are limited in what one can
use and you want to keep them simple.

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