Hi Ivan,

Sorry for the late response. That's unfortunate that we can't reliably get
executable name on FreeBSD... I would abstain from
adding yet another runtime flag or interface function for that purpose,
though. I'd rather fix the test to pass on FreeBSD.

For instance, if you that the name of executable is either "%t", or
"/proc/self/exe", you can do sed replace before running diff on files,
or disregard the executable name completely by "cut -d' ' -f2". Either
option would look fine for me.





On Fri, Apr 3, 2015 at 4:00 AM, Ivan A. Kosarev <[email protected]>
wrote:

> Hello Alexey,
>
> As you know some Asan tests leverage 'diff' to make sure coverage produce
> identical results in cases they should be so, like with the
> coverage-tracing.cc test for example. There's a problem about running such
> tests on FreeBSD as the .sancov files generated contain the name of the
> executable which is not guaranteed to be available on FreeBSD and thus the
> comparison may fail even if the files to compare refer to the same values.
> The more the number of threads the tests are run in, the higher chances one
> of the sysctl(KERN_PROC_PATHNAME) calls will fail. On the FreeBSD buildbot
> running the tests in 64 threads, it constantly results in failures on such
> kind of tests:
>
> http://lab.llvm.org:8011/builders/sanitizer_x86_64-
> freebsd/builds/4904/steps/make-check-asan/logs/stdio
>
> ---
> FAIL: AddressSanitizer-x86_64-freebsd :: TestCases/coverage-tracing.cc
> (987 of 1106)
> ******************** TEST 'AddressSanitizer-x86_64-freebsd ::
> TestCases/coverage-tracing.cc' FAILED ********************
> ...
> rm -rf /usr/home/buildslave/slave_as-bldslv5/sanitizer_x86_64-
> freebsd/llvm.obj/projects/compiler-rt/test/asan/X86_
> 64FreeBSDConfig/TestCases/Output/coverage-tracing
> --
> Exit Code: 1
>
> Command Output (stdout):
> --
> 1,3c1,3
> < /usr/home/buildslave/slave_as-bldslv5/sanitizer_x86_64-
> freebsd/llvm.obj/projects/compiler-rt/test/asan/X86_
> 64FreeBSDConfig/TestCases/Output/coverage-tracing.cc.tmp 0x478a39
> < /usr/home/buildslave/slave_as-bldslv5/sanitizer_x86_64-
> freebsd/llvm.obj/projects/compiler-rt/test/asan/X86_
> 64FreeBSDConfig/TestCases/Output/coverage-tracing.cc.tmp 0x478a69
> < /usr/home/buildslave/slave_as-bldslv5/sanitizer_x86_64-
> freebsd/llvm.obj/projects/compiler-rt/test/asan/X86_
> 64FreeBSDConfig/TestCases/Output/coverage-tracing.cc.tmp 0x478b9f
> ---
> > /proc/self/exe 0x478a39
> > /proc/self/exe 0x478a69
> > /proc/self/exe 0x478b9f
> ---
>
> Note that these failed sysctl(KERN_PROC_PATHNAME) calls are not considered
> a defect nor a subject for any kind of improvement that could change the
> behavior, see related discussion at:
>
> https://lists.freebsd.org/pipermail/freebsd-hackers/
> 2014-November/046479.html
>
> (It is also noted that similar behavior is possible for Linux too under
> some circumstances, BTW.) The question is: do you think you could advice a
> way to handle this issue? Say, what if we introduce a sanitizer option that
> explicitly sets the binary name or forces it to have some pre-defined
> value, like '/proc/self/exe'?
>
> Thanks.
>
> --
>
>


-- 
Alexey Samsonov, Mountain View, CA

-- 
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to