Hi Nick, <div>Thanks for the bug report!</div><div>I've submitted r160853 which fixes both strcmp and strncmp. <br><br><div class="gmail_quote">On Fri, Jul 27, 2012 at 12:57 AM, Nick Kralevich <span dir="ltr"><<a href="mailto:nnk@google.com" target="_blank">nnk@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I filed <a href="http://code.google.com/p/address-sanitizer/issues/detail?id=94" target="_blank">http://code.google.com/p/address-sanitizer/issues/detail?id=94</a>,<br>

but I was told that this mailing list is a better place to submit<br>
patches.<br></blockquote><div><br></div><div>Either one is fine. </div><div><br></div><div>--kcc </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If ASAN's strncmp function is called early enough in a program's<br>
lifecycle, ASAN will segfault. This is due to ASAN's strncmp not<br>
calling ENSURE_ASAN_INITED().  More details are in the bug above.<br>
<br>
A 1 line patch is attached which resolves this issue.<br>
<br>
A similar bug is present in ASAN's strcmp function.  It too does not<br>
call ENSURE_ASAN_INITED().  It's not clear to me whether this is<br>
intentional or not.<br>
<span class="HOEnZb"><font color="#888888"><br>
-- Nick<br>
</font></span><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>