<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Aleksey,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">For reference, here is the error message as it appeared on my machine (the previous output was from our build bot):<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black">Command Output (stderr):<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black">--<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black">/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<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black">// CHECK: #0 {{.*}} in free {{.*}}hwasan_interceptors.cc<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black">           ^<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"><stdin>:9:2: note: scanning from here<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black">#0 0x563436478410 in __interceptor_cfree.localalias.76 /home/dyung/src/git/dev/llvm/projects/compiler-rt/lib/hwasan/hwasan_interceptors.cc:183<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black">^<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"><stdin>:9:97: note: possible intended match here<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black">#0 0x563436478410 in __interceptor_cfree.localalias.76 /home/dyung/src/git/dev/llvm/projects/compiler-rt/lib/hwasan/hwasan_interceptors.cc:183<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Douglas Yung<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Aleksey Shlyapnikov [mailto:alekseys@google.com]
<br>
<b>Sent:</b> Monday, March 26, 2018 19:48<br>
<b>To:</b> Yung, Douglas<br>
<b>Cc:</b> llvm-commits<br>
<b>Subject:</b> Re: [compiler-rt] r328407 - [HWASan] Fix use-after-free.cc test on x86-64<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Thank you for the report and sorry for the trouble, Douglas.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Not sure what is going wrong and more details about your environment would certainly help. The test output before FileCheck would also be helpful.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I think making that CHECK more generous will resolve the problem, like this:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:"Arial","sans-serif";color:#222222;background:white"> // CHECK: #0 {{.*}} in
</span><span style="font-family:"Arial","sans-serif";color:#222222;background:white">{{.*}}</span><span style="font-size:9.5pt;font-family:"Arial","sans-serif";color:#222222;background:white">free {{.*}}hwasan_interceptors.cc</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">but I'd still like to know what causes the difference in output.<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Mon, Mar 26, 2018 at 6:25 PM, <<a href="mailto:douglas.yung@sony.com" target="_blank">douglas.yung@sony.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">Hi Alex,<br>
<br>
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.<br>
<br>
For reference, here is the test output:<br>
<br>
/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<br>
 // CHECK: #0 {{.*}} in free {{.*}}hwasan_interceptors.cc<br>
           ^<br>
<stdin>:9:2: note: scanning from here<br>
 #0 0x7fb5893a3fd8 in __interceptor_free /home/siadmin/jenkins/w/opensource/opensource_build/llvm/projects/compiler-rt/lib/hwasan/hwasan_interceptors.cc:176:3<br>
 ^<br>
<stdin>:9:110: note: possible intended match here<br>
 #0 0x7fb5893a3fd8 in __interceptor_free /home/siadmin/jenkins/w/opensource/opensource_build/llvm/projects/compiler-rt/lib/hwasan/hwasan_interceptors.cc:176:3<br>
<br>
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.<br>
<br>
Douglas Yung<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
> -----Original Message-----<br>
> From: llvm-commits [mailto:<a href="mailto:llvm-commits-bounces@lists.llvm.org">llvm-commits-bounces@lists.llvm.org</a>] On Behalf Of<br>
> Alex Shlyapnikov via llvm-commits<br>
> Sent: Friday, March 23, 2018 19:11<br>
> To: <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> Subject: [compiler-rt] r328407 - [HWASan] Fix use-after-free.cc test on x86-64<br>
><br>
> Author: alekseyshl<br>
> Date: Fri Mar 23 19:10:49 2018<br>
> New Revision: 328407<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=328407&view=rev" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=328407&view=rev</a><br>
> Log:<br>
> [HWASan] Fix use-after-free.cc test on x86-64<br>
><br>
> Differential Revision: <a href="https://reviews.llvm.org/D44705" target="_blank">
https://reviews.llvm.org/D44705</a><br>
><br>
> Modified:<br>
>     compiler-rt/trunk/test/hwasan/TestCases/use-after-free.cc<br>
><br>
> Modified: compiler-rt/trunk/test/hwasan/TestCases/use-after-free.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-</a><br>
> rt/trunk/test/hwasan/TestCases/use-after-<br>
> free.cc?rev=328407&r1=328406&r2=328407&view=diff<br>
> ==============================================================================<br>
> --- compiler-rt/trunk/test/hwasan/TestCases/use-after-free.cc (original)<br>
> +++ compiler-rt/trunk/test/hwasan/TestCases/use-after-free.cc Fri Mar 23<br>
> 19:10:49 2018<br>
> @@ -32,7 +32,7 @@ int main() {<br>
>    // CHECK: #1 {{.*}} in main {{.*}}use-after-free.cc:16<br>
><br>
>    // CHECK: previously allocated here:<br>
> -  // CHECK: #0 {{.*}} in __interceptor_malloc {{.*}}hwasan_interceptors.cc<br>
> +  // CHECK: #0 {{.*}} in {{.*}}malloc {{.*}}hwasan_interceptors.cc<br>
>    // CHECK: #1 {{.*}} in main {{.*}}use-after-free.cc:15<br>
><br>
>    // CHECK: SUMMARY: HWAddressSanitizer: tag-mismatch {{.*}} in main<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>