<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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
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;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;
        mso-fareast-language:EN-US;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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 bgcolor="white" lang="HU" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="color:windowtext">Hi Aleksei,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:windowtext">your review would be very highly appreciated in any pace and form.
</span><span lang="EN-US" style="font-family:Wingdings;color:windowtext">J</span><span lang="EN-US" style="color:windowtext"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:windowtext">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:windowtext">Daniel<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:windowtext"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="color:windowtext;mso-fareast-language:HU">From:</span></b><span lang="EN-US" style="color:windowtext;mso-fareast-language:HU"> Aleksei Sidorin [mailto:a.sidorin@samsung.com]
<br>
<b>Sent:</b> 2017. március 31. 18:03<br>
<b>To:</b> Dániel Krupp <daniel.krupp@ericsson.com>; cfe-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [cfe-dev] Cross Translational Unit Analysis in Clang Static Analyzer<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hello Daniel & Gabor. Thank you very much for your work!<br>
<br>
I saw the patch and found it mostly familiar for me. But, unfortunately, now I cannot find enough time to make its review (my solutions that were implemented 2 years ago need some revisiting too).<br>
<br>
I can try to do this review incrementally, by small chunks, if you are OK with it. But it will still take time. Sorry for this inconvenience.<br>
<br>
<br>
31.03.2017 18:28, Dániel Krupp via cfe-dev пишет:<span style="font-size:12.0pt;mso-fareast-language:HU"><o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US">Hi All,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">at the EuroLLVM’17 conference we presented our results  about a new analysis mode in clang static analyzer: Cross Translational Unit analysis.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">See patch <a href="https://reviews.llvm.org/D30691">
https://reviews.llvm.org/D30691</a></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">which is based on the work of A. Sidorin et al.
<a href="http://lists.llvm.org/pipermail/cfe-dev/2015-October/045730.html" target="_blank">
<span style="font-size:10.0pt">http://lists.llvm.org/pipermail/cfe-dev/2015-October/045730.html</span></a>, but without function summaries and updated to the newest Clang.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">The CTU mode allows the analyzer to “inline” function calls that are defined in another TU than the one currently analyzed.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">So it allows to find bugs that span multiple source files.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Without this patch the static analyzer engine, when meets an external function call,
</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">cannot reason about the return value of a function (unknown) and the pointed values, references passed to a function as parameter are invalidated.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">You can find a full patched clang 4.0 (use it with llvm commit 01609a325b5f85d88e3ab5c7d470409092436cb2 )</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"><a href="https://github.com/dkrupp/clang/tree/ctu-master">https://github.com/dkrupp/clang/tree/ctu-master</a></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">We have run the analysis on some reasonably-sized  (ffmpeg, curl, vim, openssl, postgresql) open source C projects and found many additional true positive reports compared to the traditional single TU mode in all projects.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">This indicates that this feature would give many new results on any project.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">We measured the heap usage, the analysis time and the number of new findings.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">You can find the detailed comparison results here:</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"><a href="http://cc.elte.hu/clang-ctu/">http://cc.elte.hu/clang-ctu/</a></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">In summary, the number of reported bugs is ~1.5-5x times the original single TU analysis, at the cost of 1.5-5x higher analysis time, 1.5-5x max heap usage (roughly in proportion to the increase in the number of reported
 faults).</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">The design concept is described shortly in this document:
<a href="http://cc.elte.hu/clang-ctu/eurollvm17/abstract.pdf">http://cc.elte.hu/clang-ctu/eurollvm17/abstract.pdf</a></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">If you would like to try this analysis mode on your project please find the description of the 2 new additional analyzer scripts here:</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"><a href="https://github.com/dkrupp/clang/blob/ctu-master/tools/xtu-build-new/readme.md">https://github.com/dkrupp/clang/blob/ctu-master/tools/xtu-build-new/readme.md</a></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Would be  happy to hear your opinion and experiences with this feature and would appreciate your help in reviewing the patch.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Thanks & Regards,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Daniel</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:HU"><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>cfe-dev mailing list<o:p></o:p></pre>
<pre><a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><o:p></o:p></pre>
<pre><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:HU"><o:p> </o:p></span></p>
<p><o:p> </o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Best regards,<o:p></o:p></pre>
<pre>Aleksei Sidorin,<o:p></o:p></pre>
<pre>SRR, Samsung Electronics<o:p></o:p></pre>
</div>
</body>
</html>