[lldb-dev] run tests with ASAN (dotest.py)

Pavel Labath via lldb-dev lldb-dev at lists.llvm.org
Fri Aug 3 02:31:44 PDT 2018


When I looked into this in the past (two years ago), the problem was
that the sanitizer runtimes were expected to be linked into the main
executable. For the dotest tests, the main executable is "python", so
unless you have built an asanified python, you will not have them.

You might be able to get them loaded via some LD_PRELOAD tricks, but I
am not sure if the overall result will be worth the trouble. In
general, the sanitizers expect that your whole process is sanitized,
and they tend to report a lot of false positives if that is not the
case.
On Fri, 3 Aug 2018 at 00:31, Vedant Kumar via lldb-dev
<lldb-dev at lists.llvm.org> wrote:
>
> Hi Gábor,
>
> That symbol appears to be defined in compiler-rt/lib/asan/asan_rtl.cc, so it should be provided by the asan runtime. Are you sure that the runtime expected by the host compiler is being dynamically loaded here? You can check this using 'ldd' (IIRC) on Linux or 'otool -l' on Darwin. Also, did you take the extra step needed to preload the runtime (LD_PRELOAD/DYLD_INSERT_LIBRARIES)?
>
> best,
> vedant
>
>
> On Aug 2, 2018, at 12:24 PM, Gábor Márton via lldb-dev <lldb-dev at lists.llvm.org> wrote:
>
> Hi,
>
> I'd like to run the tests, when LLVM, Clang and LLDB are all built with ASAN.
> I am using release_60 version of LLDB.
> The unittests just run fine, but with `dotest.py`, there is an error.
> Maybe the LLDB build does not respect the global -DLLVM_USE_SANITIZER
> flag of cmake ?
>
> Any help would be appreciated,
> Thanks,
> Gabor
>
>
> ```
> /var/jenkins_home/workspace/ctu_pipeline/llvm/tools/lldb/test/dotest.py
> --executable /var/jenkins_home/workspace/ctu_pipeline/build/bin/lldb
> /var/jenkins_home/workspace/ctu_pipeline/llvm/tools/lldb/packages/Python/lldbsuite/test/
> -v --excluded ./lldb_test_exclude
> lldb version 6.0.0 (https://github.com/llvm-mirror/lldb.git revision
> b6df24ff1b258b18041161b8f32ac316a3b5d8d9)
>  clang revision 64eed461cdd3705e7bc1ccc95df9858f7fe216a8
>  llvm revision 089d4c0c490687db6c75f1d074e99c4d42936a50
> ['/var/jenkins_home/workspace/ctu_pipeline/llvm/tools/lldb/test/dotest.py',
> '--executable',
> '/var/jenkins_home/workspace/ctu_pipeline/build/bin/lldb',
> '/var/jenkins_home/workspace/ctu_pipeline/llvm/tools/lldb/packages/Python/lldbsuite/test/',
> '-v', '--excluded', './lldb_test_exclude']
> LLDB library dir: /var/jenkins_home/workspace/ctu_pipeline/build/bin
> LLDB import library dir: /var/jenkins_home/workspace/ctu_pipeline/build/bin
> The 'lldb-mi' executable cannot be located.  The lldb-mi tests can not
> be run as a result.
> Traceback (most recent call last):
>  File "/var/jenkins_home/workspace/ctu_pipeline/llvm/tools/lldb/test/dotest.py",
> line 7, in <module>
>    lldbsuite.test.run_suite()
>  File "/var/jenkins_home/workspace/ctu_pipeline/llvm/tools/lldb/packages/Python/lldbsuite/test/dotest.py",
> line 1129, in run_suite
>    import lldb
>  File "/var/jenkins_home/workspace/ctu_pipeline/build/lib/python2.7/site-packages/lldb/__init__.py",
> line 53, in <module>
>    _lldb = swig_import_helper()
>  File "/var/jenkins_home/workspace/ctu_pipeline/build/lib/python2.7/site-packages/lldb/__init__.py",
> line 49, in swig_import_helper
>    _mod = imp.load_module('_lldb', fp, pathname, description)
> ImportError: /var/jenkins_home/workspace/ctu_pipeline/build/lib/libLLVMDemangle.so.6:
> undefined symbol: __asan_option_detect_stack_use_after_return
>
> ```
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


More information about the lldb-dev mailing list