<div dir="ltr">Actually, sigh, we didn't do that already because we hand them back to the user as well.<div>Anyway, i'm working up a patch to fix these.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 2, 2016 at 10:56 AM, Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</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"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Mar 2, 2016 at 10:38 AM, Justin Lebar <span dir="ltr"><<a href="mailto:jlebar@google.com" target="_blank">jlebar@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">jlebar added a comment.<br>
<span><br>
> Please let me know if that didn't end up fixing it (I lack an ASAN-instrumented build of LLVM :) ).<br>
<br>
<br>
</span>Works now, although now that it's fixed asan is showing me memory leaks.  :)  One seems to be in the test itself, but another appears to be in the actual code.<br>
<br>
Clearly not as urgent, but here's the report:<br>
<br>
  ********************<br>
  FAIL: LLVM-Unit :: Transforms/Utils/UtilsTests/MemorySSA.RemoveMemoryAccess (15985 of 15994)<br>
<span>  ******************** TEST 'LLVM-Unit :: Transforms/Utils/UtilsTests/MemorySSA.RemoveMemoryAccess' FAILED ********************<br>
  Note: Google Test filter = MemorySSA.RemoveMemoryAccess<br>
  [==========] Running 1 test from 1 test case.<br>
  [----------] Global test environment set-up.<br>
  [----------] 1 test from MemorySSA<br>
  [ RUN      ] MemorySSA.RemoveMemoryAccess<br>
</span>  [       OK ] MemorySSA.RemoveMemoryAccess (25 ms)<br>
  [----------] 1 test from MemorySSA (25 ms total)<br>
<br>
  [----------] Global test environment tear-down<br>
  [==========] 1 test from 1 test case ran. (26 ms total)<br>
  [  PASSED  ] 1 test.<br>
<br>
  =================================================================<br>
  ==147403==ERROR: LeakSanitizer: detected memory leaks<br>
<br>
  Direct leak of 304 byte(s) in 1 object(s) allocated from:<br>
      #0 0x4c66ab in operator new(unsigned long) (/usr/local/google/home/jlebar/code/llvm/asan/unittests/Transforms/Utils/UtilsTests+0x4c66ab)<br>
      #1 0xc89da5 in llvm::MemorySSA::buildMemorySSA(llvm::AAResults*, llvm::DominatorTree*) /usr/local/google/home/jlebar/llvm/src/lib/Transforms/Utils/MemorySSA.cpp:234:3<br>
      #2 0x58f1eb in MemorySSA_RemoveMemoryAccess_Test::TestBody() /usr/local/google/home/jlebar/llvm/src/unittests/Transforms/Utils/MemorySSA.cpp:55:29<br>
      #3 0xd60843 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /usr/local/google/home/jlebar/llvm/src/utils/unittest/googletest/src/gtest.cc:2145:12<br>
      #4 0xd60843 in testing::Test::Run() /usr/local/google/home/jlebar/llvm/src/utils/unittest/googletest/src/gtest.cc:2161<br>
      #5 0xd651d4 in testing::TestInfo::Run() /usr/local/google/home/jlebar/llvm/src/utils/unittest/googletest/src/gtest.cc:2309:5<br>
      #6 0xd66496 in testing::TestCase::Run() /usr/local/google/home/jlebar/llvm/src/utils/unittest/googletest/src/gtest.cc:2416:5<br>
      #7 0xd7f5fa in testing::internal::UnitTestImpl::RunAllTests() /usr/local/google/home/jlebar/llvm/src/utils/unittest/googletest/src/gtest.cc:4207:11<br>
      #8 0xd7e82f in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /usr/local/google/home/jlebar/llvm/src/utils/unittest/googletest/src/gtest.cc:2145:12<br>
      #9 0xd7e82f in testing::UnitTest::Run() /usr/local/google/home/jlebar/llvm/src/utils/unittest/googletest/src/gtest.cc:3841<br>
      #10 0xd365e7 in main /usr/local/google/home/jlebar/llvm/src/utils/unittest/UnitTestMain/TestMain.cpp:47:10<br>
      #11 0x7fb091525ec4 in __libc_start_main /build/eglibc-3GlaMS/eglibc-2.19/csu/libc-start.c:287<br>
<br></blockquote><div><br></div><div><br></div></div></div><div>This is because the walker is not reset when MemorySSALazy::releaseMemory is called.</div><div>This is intentional at the time, because people may want MemorySSA built with a different non-default walker.  We stopped letting this happen at some point, and so we should just add Walker.reset() to MemorySSALazy::releaseMemory and declare victory.</div><div><br></div><div><br></div></div><br></div></div>
</blockquote></div><br></div>