<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 28, 2015 at 8:15 AM, Viktor Kutuzov <span dir="ltr"><<a href="mailto:vkutuzov@accesssoftek.com" target="_blank">vkutuzov@accesssoftek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">OK, it makes sense, thanks. However, while it works for Asan's ##__asan_init()t## called from the code injected by the instrumentation part, it doesn't work for UBsan where, in omission of SANITIZER_CAN_USE_PREINIT_ARRAY, ##__ubsan::InitIfNecessary()## is called from a regular constructor which has a lower priority than ##__sanitizer_cov_module_init##. Maybe we should introduce instrumentation for UBsan or just replace the ##ubsan_initializer## declaration:<br>
<br>
  class UbsanInitializer {<br>
   public:<br>
    UbsanInitializer() {<br>
      InitIfNecessary();<br>
    }<br>
  };<br>
  static UbsanInitializer ubsan_initializer;<br>
<br>
with something like:<br>
<br>
  __attribute__((constructor(1)))<br>
  void __init_ubsan() {<br>
    InitIfNecessary();<br>
<div class=""><div class="h5">  }<br></div></div></blockquote><div><br></div><div>+glider</div><div><br></div><div>Do constructors with different priority work on Mac? IIRC they don't (and we had to disable init-order checker on Mac because of that). Sadly, Mac also has SANITIZER_CAN_USE_PREINIT_ARRAY=0.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">
<br>
<br>
REPOSITORY<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D6892" target="_blank">http://reviews.llvm.org/D6892</a><br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</div></div>