On Mon, Apr 20, 2015 at 6:39 AM, Ivan A. Kosarev <[email protected]>
wrote:

>  Thanks, Alexey. Unfortunately, editing the output won't work for tests
> where the "/proc/self/exe" is generated in place of the object file for
> symbolization purposes, like this:
>
> FAIL: AddressSanitizer-i386-freebsd :: TestCases/Posix/wait.cc (648 of
> 1026)
> ...
> --
> Exit Code: 1
>
> Command Output (stderr):
> --
> /usr/home/ik/llvm/llvm.current/projects/compiler-rt/test/asan/TestCases/Posix/wait.cc:37:12:
> error: expected string not found in input
>  // CHECK: {{in .*wait}}
>            ^
> <stdin>:4:1: note: scanning from here
> ==38341==WARNING: readlink("/proc/self/exe") failed with errno 2, some
> stack frames may not be symbolized
> ^
> <stdin>:10:66: note: possible intended match here
> Address 0xffffd93c is located in stack of thread T0 at offset 28 in frame
>                                                                  ^
>
> These are virtually all tests that match the run-time reports. Given we
> rely on getting the object file and the path to the subject executable is
> necessary for producing the output in the form the tests expect it, then it
> seems the only way to fix this is to somehow pass the file name to the RTL
> explicitly?
>

That is, sysctl(CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME) may spuriously
fail on FreeBSD, and it's not expected to be fixed in future? That is kind
of unfortunate,
it means that regular ASan users on FreeBSD will occasionally see
unsymbolized reports, and this behavior would look weird...

We can of course add a runtime flag to make the test suite more stable, but
it wouldn't make the tool itself more stable - regular users won't really
pass path to executable in ASAN_OPTIONS.
Can we either reduce the load on the buildbot, or make several attempts of
KERN_PROC_PATHNAME syscall?




>
> Thanks again.
>
>
>
> On 04/14/2015 07:17 PM, Alexey Samsonov wrote:
>
> 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
>
>
> --
>
>


-- 
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