<div dir="ltr">in the long run, that makes sense.<div><br></div><div>currently, i'm trying to figure out why TestMemoryHistory.py is not working on Ubuntu. I was trying to see how TestMemoryHistory.py functioned on OSX for comparison. for now, i may try to install compiler-rt on OSX, so that unit test will compile on OSX</div><div><br></div><div>on Ubuntu, TestMemoryHistory.py is compiling and running, but does not seem to be relaunching the process to insert its library. the first "thread list" after the initial "run" is reporting that the "stop reason = breakpoint", not "stop reason = exec"</div><div><br></div><div>doug</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 29, 2014 at 3:09 PM, Kuba Brecka <span dir="ltr"><<a href="mailto:kuba.brecka@gmail.com" target="_blank">kuba.brecka@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>You're right. The test should be conditional, and only run if your compiler has ASan. There has been some recent discussion on lldb-commits with the same conclusion. If that failing/erroring test bothers you, send out a patch that just skips the test. I'm pretty sure it would get accepted as a temporary solution until I add the conditional skip. </div><div><br></div><div>Kuba<br><br>Sent from my iPhone</div><div><br>On Oct 29, 2014, at 2:52 PM, Doug Snyder <<a href="mailto:dsnyder@blueshiftinc.com" target="_blank">dsnyder@blueshiftinc.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">is the install/build of compiler-rt a special step needed just for OSX? <div><br></div><div>i don't seem to need a special build of compiler-rt to get TestMemoryHistory.py to compile on ubuntu.</div><div><br></div><div>also, <a href="http://lldb.llvm.org/build.html" target="_blank">http://lldb.llvm.org/build.html</a> does not seem to list this as one of the requirements needed to build lldb</div><div><br></div><div>since lldb does not appear to assume that asan is present, maybe the unit test should be skipped if the asan library is not installed/present</div><div><br></div><div>doug</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 29, 2014 at 2:31 PM, Kuba Brecka <span dir="ltr"><<a href="mailto:kuba.brecka@gmail.com" target="_blank">kuba.brecka@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><a href="http://compiler-rt.llvm.org" target="_blank">http://compiler-rt.llvm.org</a></div><div><br></div><div>You should check out its source into /projects/ and just build as usually. </div><div><br></div><div>Kuba<br><br>Sent from my iPhone</div><div><br>On Oct 29, 2014, at 2:27 PM, Doug Snyder <<a href="mailto:dsnyder@blueshiftinc.com" target="_blank">dsnyder@blueshiftinc.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">what is "compiler-rt"?<div><br></div><div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 29, 2014 at 2:21 PM, Kuba Brecka <span dir="ltr"><<a href="mailto:kuba.brecka@gmail.com" target="_blank">kuba.brecka@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It's probably compiler-rt missing in the build of llvm/clang. Without it, your built clang doesn't have ASan (doesn't understand -fsanitize=address). Can you try building with compiler-rt?<div><br></div><div>Kuba</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 29, 2014 at 1:54 PM, Doug Snyder <span dir="ltr"><<a href="mailto:dsnyder@blueshiftinc.com" target="_blank">dsnyder@blueshiftinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">i don't know if you are the person to ask, but git says you wrote TestMemoryHistory.py, so i thought i'd start with you.<div><br></div><div>when i run unit test TestMemoryHistory.py on OSX, the unit test won't compile/link and complains that libclang_rt.asan_osx_dynamic.dylib can't be found<div><br></div><div>if i remove "-fsanitize=address " (added from the Makefile in that directory) from the compile/link, the unit test builds fine</div><div><br></div><div>is there something i need to do to make this unit test work on OSX?</div><div><br></div><div>were you able to get this unit test to build on OSX?</div><div><br></div><div><br></div>
</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Jul 14, 2014 at 6:24 PM, Kuba Břečka <span dir="ltr"><<a href="mailto:kuba.brecka@gmail.com" target="_blank">kuba.brecka@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div>Hi,</div><div><br></div><div>I'm trying to create a better support for debugging ASan-enabled binaries in LLDB. I already started by proposing some API into the ASan runtime library (<a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-July/074656.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-July/074656.html</a>), which should enable the debugger to query various additional information the runtime can provide. Basically this means:</div>
<div><br></div><div>* malloc/free traces - given a memory address, the ASan runtime can return recorded stack trace(s) of how that chunk of memory was allocated and/or freed.</div><div><br></div><div>* shadow mapping information - these say how exactly is a memory address mapped into the shadow memory and back.</div>
<div><br></div><div>* locating a memory address - ASan tracks globals and stack variables, so it can provide a name (and size) given such a memory address; for heap addresses it can give out the starting address and size of that chunk.</div>
<div><br></div><div>* gathering report information - when ASan detects an error, the reporting mechanism can provide additional information, e.g. what kind of bug was found ("heap-use-after-free").</div><div><br>
</div><div>For the malloc/free stack traces, it seems the best way to add this feature would be to extend the ValueObject class with a generic API to retrieve a list of HistoryThread objects, with some additional enum/constant-string to tell the type of individual threads. Something like:</div>
<div><span style="white-space:pre-wrap"> </span></div><div><span style="white-space:pre-wrap"> </span>ThreadList &</div><div><span style="white-space:pre-wrap"> </span>ValueObject::GetStackTraces() { ... }</div>
<div><br></div><div>The API for this should be reusable for other libraries/tools, for example malloc_history could provide a very similar information. Since I want this to be available in the SB API as well, Python scripting seems not to be the way to go.</div>
<div><br></div><div>The goal is to have ASan-aware LLDB commands, such as:</div><div><br></div><div><span style="white-space:pre-wrap"> </span>(lldb) expr -x 0xf00f00</div><div><span style="white-space:pre-wrap"> </span>// prints out the value of the expression, and if it's a pointer also</div>
<div><span style="white-space:pre-wrap"> </span>// prints the malloc and free stack traces</div><div><span style="white-space:pre-wrap"> </span>(lldb) memory read --shadow 0xf00f00</div><div><span style="white-space:pre-wrap"> </span>// prints out the corresponding shadow memory instead</div>
<div><span style="white-space:pre-wrap"> </span>(lldb) memory locate 0xf00f00</div><div><span style="white-space:pre-wrap"> </span>// says it's a stack variable with name "foo", size, starting address</div>
<div><br></div><div>I'll send patch(es) shortly, but do you have any comments/hints on the idea in general?</div><div><br></div><div>Thanks,</div><div>Kuba</div><div><br></div></div>
<br></div></div><span>_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br></span></blockquote></div><br></div>
</blockquote></div><br></div>
</blockquote></div><br></div>
</div></blockquote></div></blockquote></div><br></div>
</div></blockquote></div></blockquote></div><br></div>