<div dir="ltr">Hi Peter!<br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 13, 2013 at 4:38 AM, Peter Collingbourne <span dir="ltr"><<a href="mailto:peter@pcc.me.uk" target="_blank">peter@pcc.me.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I need to be able to use a special case list file containing thousands<br>
of entries (namely, a list of libc symbols, to be used when using<br>
DFSan with an uninstrumented libc).  Initially I built the symbol<br>
list like this:<br>
<br>
fun:sym1=uninstrumented<br>
fun:sym2=uninstrumented<br>
fun:sym3=uninstrumented<br>
...<br>
fun:sym6000=uninstrumented<br>
<br>
What I found was that, despite various bits of documentation [1,2],<br>
the symbol names are matched as substrings, the root cause being that<br>
the regular expressions built by the SpecialCaseList class do not<br>
contain anchors.  The attached unit test demonstrates the problem.<br>
If I modify my symbol list to contain anchors:<br>
<br>
fun:^sym1$=uninstrumented<br>
fun:^sym2$=uninstrumented<br>
fun:^sym3$=uninstrumented<br>
...<br>
fun:^sym6000$=uninstrumented<br>
<br>
the behaviour is as expected, but compiler run time is slow (on the<br>
order of seconds), presumably because our regex library doesn't cope<br>
with anchors very efficiently.<br>
<br>
I intend to resolve the substring bug and the slow run time issue<br>
by using a StringSet for symbol patterns which do not contain regex<br>
metacharacters.  There would still be a regex for any other patterns,<br>
which would have anchors added automatically.<br></blockquote><div><br></div><div>I think that it's fine to add anchors automatically to implement the behavior</div><div>described in the docs (I've LGTMed that patch). Do you want to avoid adding anchors</div>
<div>for dfsan SpecialCaseList?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thoughts?<br>
<br>
Thanks,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Peter<br>
<br>
[1] <a href="https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer" target="_blank">https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer</a><br>
[2] <a href="https://code.google.com/p/thread-sanitizer/wiki/Flags" target="_blank">https://code.google.com/p/thread-sanitizer/wiki/Flags</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div>