[compiler-rt] r328407 - [HWASan] Fix use-after-free.cc test on x86-64

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 26 22:08:07 PDT 2018


Hi Aleksey,

I think you need to make it slightly more generous with what it accepts. The output I am seeing generated on my local machine is slightly different and still failed when I applied your suggested fix.

For reference, here is the error message as it appeared on my machine (the previous output was from our build bot):

Command Output (stderr):
--
/home/dyung/src/git/dev/llvm/projects/compiler-rt/test/hwasan/TestCases/use-after-free.cc:31:12: error: expected string not found in input
// CHECK: #0 {{.*}} in free {{.*}}hwasan_interceptors.cc
           ^
<stdin>:9:2: note: scanning from here
#0 0x563436478410 in __interceptor_cfree.localalias.76 /home/dyung/src/git/dev/llvm/projects/compiler-rt/lib/hwasan/hwasan_interceptors.cc:183
^
<stdin>:9:97: note: possible intended match here
#0 0x563436478410 in __interceptor_cfree.localalias.76 /home/dyung/src/git/dev/llvm/projects/compiler-rt/lib/hwasan/hwasan_interceptors.cc:183

I found that if I modified the CHECK line to contain “{{.*}}free{{.*}} the test passes on my machine, and presumably would also pass on our build bot.

Do you think that you could commit that change if you feel it is okay and then I can follow up with you offline to try and determine what is happening here?

Douglas Yung

From: Aleksey Shlyapnikov [mailto:alekseys at google.com]
Sent: Monday, March 26, 2018 19:48
To: Yung, Douglas
Cc: llvm-commits
Subject: Re: [compiler-rt] r328407 - [HWASan] Fix use-after-free.cc test on x86-64

Thank you for the report and sorry for the trouble, Douglas.

Not sure what is going wrong and more details about your environment would certainly help. The test output before FileCheck would also be helpful.

I think making that CHECK more generous will resolve the problem, like this:
 // CHECK: #0 {{.*}} in {{.*}}free {{.*}}hwasan_interceptors.cc

but I'd still like to know what causes the difference in output.

On Mon, Mar 26, 2018 at 6:25 PM, <douglas.yung at sony.com<mailto:douglas.yung at sony.com>> wrote:
Hi Alex,

This test is still failing on our internal build bot which simply does a x86-64 linux build/test of each upstream commit. I would point you to a public build bot that shows the failure, but unfortunately I don't seem to find any. I have been able to reproduce the failure on my linux box outside of the bot using the same build/test commands, so it doesn't seem to be a problem specific to that one machine.

For reference, here is the test output:

/home/siadmin/jenkins/w/opensource/opensource_build/llvm/projects/compiler-rt/test/hwasan/TestCases/use-after-free.cc:31:12: error: expected string not found in input
 // CHECK: #0 {{.*}} in free {{.*}}hwasan_interceptors.cc
           ^
<stdin>:9:2: note: scanning from here
 #0 0x7fb5893a3fd8 in __interceptor_free /home/siadmin/jenkins/w/opensource/opensource_build/llvm/projects/compiler-rt/lib/hwasan/hwasan_interceptors.cc:176:3
 ^
<stdin>:9:110: note: possible intended match here
 #0 0x7fb5893a3fd8 in __interceptor_free /home/siadmin/jenkins/w/opensource/opensource_build/llvm/projects/compiler-rt/lib/hwasan/hwasan_interceptors.cc:176:3

Any ideas on why this might be failing? If this isn't enough, I can provide you with more details of my environment and the build/test command lines to help you reproduce the problem.

Douglas Yung

> -----Original Message-----
> From: llvm-commits [mailto:llvm-commits-bounces at lists.llvm.org<mailto:llvm-commits-bounces at lists.llvm.org>] On Behalf Of
> Alex Shlyapnikov via llvm-commits
> Sent: Friday, March 23, 2018 19:11
> To: llvm-commits at lists.llvm.org<mailto:llvm-commits at lists.llvm.org>
> Subject: [compiler-rt] r328407 - [HWASan] Fix use-after-free.cc test on x86-64
>
> Author: alekseyshl
> Date: Fri Mar 23 19:10:49 2018
> New Revision: 328407
>
> URL: http://llvm.org/viewvc/llvm-project?rev=328407&view=rev
> Log:
> [HWASan] Fix use-after-free.cc test on x86-64
>
> Differential Revision: https://reviews.llvm.org/D44705
>
> Modified:
>     compiler-rt/trunk/test/hwasan/TestCases/use-after-free.cc
>
> Modified: compiler-rt/trunk/test/hwasan/TestCases/use-after-free.cc
> URL: http://llvm.org/viewvc/llvm-project/compiler-
> rt/trunk/test/hwasan/TestCases/use-after-
> free.cc?rev=328407&r1=328406&r2=328407&view=diff
> ==============================================================================
> --- compiler-rt/trunk/test/hwasan/TestCases/use-after-free.cc (original)
> +++ compiler-rt/trunk/test/hwasan/TestCases/use-after-free.cc Fri Mar 23
> 19:10:49 2018
> @@ -32,7 +32,7 @@ int main() {
>    // CHECK: #1 {{.*}} in main {{.*}}use-after-free.cc:16
>
>    // CHECK: previously allocated here:
> -  // CHECK: #0 {{.*}} in __interceptor_malloc {{.*}}hwasan_interceptors.cc
> +  // CHECK: #0 {{.*}} in {{.*}}malloc {{.*}}hwasan_interceptors.cc
>    // CHECK: #1 {{.*}} in main {{.*}}use-after-free.cc:15
>
>    // CHECK: SUMMARY: HWAddressSanitizer: tag-mismatch {{.*}} in main
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org<mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180327/4da70663/attachment.html>


More information about the llvm-commits mailing list