Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-7855

Fix library path handling for ASAN python tests

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      When running the python tests under ASAN, using ../test/suite/run.py --asan, it should rewrite LD_LIBRARY_PATH replacing relative pathnames with absolute pathnames.

      Using the common setting of LD_LIBRARY_PATH=./.libs, when running the python tests from build_posix, results in symbolizer output like the following on error:

      0x61000001f7cc is located 140 bytes inside of 184-byte region [0x61000001f740,0x61000001f7f8)
      freed by thread T12 here:
          #0 0x7f2fd13fae82 in free /build/llvm-toolchain-8-8.0.1~svn363027/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:124:3
          #1 0x7f2fcadb6548  (.libs/libwiredtiger-10.0.1.so+0x70e548)
          #2 0x7f2fcadd3be1  (.libs/libwiredtiger-10.0.1.so+0x72bbe1)
          #3 0x7f2fc9b066d6 in local_file_close_internal /home/smithk/src/wiredtiger/build_posix/ext/storage_sources/local_store/../../../../ext/storage_sources/local_store/local_store.c:1185:33
          #4 0x7f2fc9b06116 in local_file_close /home/smithk/src/wiredtiger/build_posix/ext/storage_sources/local_store/../../../../ext/storage_sources/local_store/local_store.c:1165:18
          #5 0x7f2fcadba7e2  (.libs/libwiredtiger-10.0.1.so+0x7127e2)
          #6 0x7f2fcadb9d27  (.libs/libwiredtiger-10.0.1.so+0x711d27)
          #7 0x7f2fca802271  (.libs/libwiredtiger-10.0.1.so+0x15a271)
          #8 0x7f2fca801e85  (.libs/libwiredtiger-10.0.1.so+0x159e85)
          #9 0x7f2fca7e7aef  (.libs/libwiredtiger-10.0.1.so+0x13faef)
          #10 0x7f2fca8d4737  (.libs/libwiredtiger-10.0.1.so+0x22c737)
          #11 0x7f2fcafe015e  (.libs/libwiredtiger-10.0.1.so+0x93815e)
          #12 0x7f2fcafd94fd  (.libs/libwiredtiger-10.0.1.so+0x9314fd)
          #13 0x7f2fcafd91c7  (.libs/libwiredtiger-10.0.1.so+0x9311c7)
          #14 0x7f2fcaac7cc3  (.libs/libwiredtiger-10.0.1.so+0x41fcc3)
          #15 0x7f2fcaac6730  (.libs/libwiredtiger-10.0.1.so+0x41e730)
          #16 0x7f2fcaf02068  (.libs/libwiredtiger-10.0.1.so+0x85a068)
          #17 0x7f2fcb437367 in _wrap_Session_flush_tier /home/smithk/src/wiredtiger/lang/python/wiredtiger_wrap.c:5692
      

      Here the symbolizer finds the SWIG python library and the tiered storage local_store library. So it symbolizes the stack addresses in those libraries. But it wasn't able to find libwiredtiger, and didn't symbolize those (rather important!) stack addresses.  We see that in former cases, which work, the we are using an absolute pathname for the libraries.  But for libwiredtiger we're using a relative pathname.

      We get the correct behavior by using absolute pathnames in LD_LIBRARY_PATH.  I.e., setting LD_LIBRARY_PATH=$(path)/.libs solve the problem.

      I speculate that this is because the test changes directory between when it opens the wiredtiger library and when it fails and invokes the symbolizer.  

       

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            keith.smith@mongodb.com Keith Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: