<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 26 Nov 2015, at 17:43 , Kevin P. Fleming <<a href="mailto:kevin@kpfleming.us" class="">kevin@kpfleming.us</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Instead of putting the directory that contains libc++/libc++abi into LD_LIBRARY_PATH, use the system's 'normal' method of locating libraries, by ensuring that directory is included in the search path built up from /etc/ld.so.conf. If
 you do this, then an RPATH in an executable *will* take precedence over the default directory, because the default directory won't be specified in LD_LIBRARY_PATH (which has the highest precedence).<br class="">
</div>
</div>
</blockquote>
<div>This, of course, would be the preferred solution. Unfortunately, while it is possible for me to influence the values in LD_LIBRARY_PATH, I cannot easily update the ldconfig cache on all cluster nodes (if at all). I am thus still interested in (and actively
 searching for) an alternative approach.</div>
<div><br class="">
</div>
<div>Michael</div>
<div><br class="">
</div>
<blockquote type="cite" class="">
<div class="">
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Thu, Nov 26, 2015 at 4:09 AM, Schlottke-Lakemper, Michael via cfe-users
<span dir="ltr" class=""><<a href="mailto:cfe-users@lists.llvm.org" target="_blank" class="">cfe-users@lists.llvm.org</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word" class=""><br class="">
<div class="">
<blockquote type="cite" class=""><span class="">
<div class="">On 25 Nov 2015, at 20:13 , Alexey Samsonov <<a href="mailto:vonosmas@gmail.com" target="_blank" class="">vonosmas@gmail.com</a>> wrote:</div>
<br class="">
</span>
<div class="">
<div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">
<div class="gmail_extra">
<div class="gmail_quote"><span class="">On Wed, Nov 25, 2015 at 4:12 AM, Schlottke-Lakemper, Michael<span class=""> </span><span dir="ltr" class=""><<a href="mailto:m.schlottke-lakemper@aia.rwth-aachen.de" target="_blank" class="">m.schlottke-lakemper@aia.rwth-aachen.de</a>></span><span class=""> </span>wrote:<br class="">
<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 style="word-wrap:break-word" class=""><span class="">
<div class="">
<blockquote type="cite" class="">
<div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">
<div class="gmail_extra">
<div class="gmail_quote"><br class="">
<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 style="word-wrap:break-word" class="">Thus I tried to compile a complete LLVM/Clang stack (with compiler-rt, libcxx, libcxxabi, libomp) using -DLLVM_USE_SANITIZER=MemoryWithOrigins. However, this did not work either, as apparently during the compilation
 process the memory sanitizer already comes to life and complains about use-of-unitialized values… Thus this approach seems to be a dead end.<span class=""><font color="#888888" class="">
<div class=""><br class="">
</div>
</font></span>
<div class=""><span class=""><font color="#888888" class="">Michael</font></span>
<div class="">
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 24 Nov 2015, at 15:28 , Michael Schlottke-Lakemper <<a href="mailto:m.schlottke-lakemper@aia.rwth-aachen.de" target="_blank" class="">m.schlottke-lakemper@aia.rwth-aachen.de</a>> wrote:</div>
<br class="">
<div class="">
<div style="word-wrap:break-word" class="">Hi folks,
<div class=""><br class="">
</div>
<div class="">When running our msan-instrumented simulation program, instead of a proper output I get the following error:</div>
<div class=""><br class="">
</div>
<div class="">==12089==WARNING: MemorySanitizer: use-of-uninitialized-value</div>
<div class="">
<div class="">==12089==WARNING: Can't read from symbolizer at fd 14</div>
<div class="">/pds/opt/llvm/bin/llvm-symbolizer: symbol lookup error: /pds/opt/libcxx-20151121-r253770-clang-msan/lib/libc++abi.so.1: undefined symbol: __msan_origin_tls</div>
<div class="">==12089==WARNING: external symbolizer didn't start up correctly!</div>
</div>
<div class=""><br class="">
</div>
<div class="">My setup for using the memory sanitizer is as follows:</div>
<div class="">- compile libc++/libc++abi with -fsanitize=memory</div>
<div class="">- compile test program with normal (=uninstrumented) LLVM/Clang installation using -fsanitize=memory</div>
<div class="">- put instrumented libcxx/libcxxabi library dirs into LD_LIBRARY_PATH</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div class="">Can you pass -Wl,-rpath when you link your executable, to specify the path to instrumented libc++/libc++abi?</div>
</div>
</div>
</div>
</blockquote>
<br class="">
</div>
</span>
<div class="">Yes, and if I do that together with setting LD_LIBRARY_PATH=“”, it works, thanks.</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Why do you need to clear LD_LIBRARY_PATH to run MSan?</div>
</span>
<div class="">What libraries from LLVM lib dir harm running the MSan-ified executalbe? I thought that if you set rpath to correct path with instrumented libraries it should be enough…</div>
</div>
</div>
</div>
</div>
</blockquote>
<br class="">
</div>
<div class="">Right now I have the problem that by default, LD_LIBRARY_PATH includes a directory with libc++/libc++abi in it. However, when running msan-instrumented executables to test them, the executable should pick up msan-instrumented versions of libc++/libc++abi
 while the subsequently used llvm-symbolizer needs to pick up the uninstrumented versions (otherwise I get the above-mentioned errors). Setting rpath is not enough, since the presence of libc++/libc++abi in LD_LIBRARY_PATH will override it. Compiling llvm-symbolizer
 in a way that it is able to run with msan-instrumented libc++ might be an option, but I don’t know how to do that (other than compiling all of LLVM with msan, which does not work either).</div>
<div class=""><br class="">
</div>
<div class="">One possible workaround that I have been using is to create a shell script, call it “llvm-symbolizer”, put</div>
<div class=""><br class="">
</div>
<div class="">LD_LIBRARY_PATH="$LLVM_DIR/lib:$LD_LIBRARY_PATH" $LLVM_DIR/bin/llvm-symbolizer $*</div>
<div class=""><br class="">
</div>
<div class="">in it, and make sure that it is on the PATH before the actual llvm-symbolizer executable (which is located in LLVM_DIR/bin). However, this is clearly a workaround and I am looking for a more robust and more “canonical” solution.</div>
<div class=""><br class="">
</div>
<div class="">Any suggestions?</div>
<span class="HOEnZb"><font color="#888888" class="">
<div class=""><br class="">
</div>
<div class="">Michael</div>
<br class="">
</font></span></div>
<br class="">
_______________________________________________<br class="">
cfe-users mailing list<br class="">
<a href="mailto:cfe-users@lists.llvm.org" class="">cfe-users@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</body>
</html>