[PATCH] Set symbolizer path in the test environment

Daniel Dunbar daniel at zuster.org
Tue Mar 12 10:27:41 PDT 2013


IMHO, it is mildly incorrect to view this as a problem to solve via the
lit.cfg.

Doesn't this indicate that there is also a problem from the user
perspective of ASAN? How is this supposed to work for the user? Do they
have to set things in their environment to get symbolized traces?

If you solve that problem then usually the test suite doesn't have to be
changed. Of course, we have tons of things like this for expediency and I
have no problem with that.

 - Daniel


On Tue, Mar 12, 2013 at 1:10 AM, Evgeniy Stepanov <eugenis at google.com>wrote:

> Hi ddunbar, samsonov,
>
> This is needed to get symbolized stack traces when running LLVM tests
> under (A|M)San.
>
> I don't like code duplication, but this seems commonplace in lit.cfg's. I
> also have an identical patch to Clang (test/ and test/Unit/), if this is
> deemed acceptable.
>
>
> http://llvm-reviews.chandlerc.com/D529
>
> Files:
>   test/Unit/lit.cfg
>   test/lit.cfg
>
> Index: test/Unit/lit.cfg
> ===================================================================
> --- test/Unit/lit.cfg
> +++ test/Unit/lit.cfg
> @@ -81,3 +81,8 @@
>          shlibpath = os.pathsep + shlibpath
>      shlibpath = config.shlibdir + shlibpath
>      config.environment[config.shlibpath_var] = shlibpath
> +
> +# Setup paths to llvm-symbolizer for Sanitizer tools.
> +llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
> +config.environment['ASAN_SYMBOLIZER_PATH'] = llvm_tools_dir +
> '/llvm-symbolizer'
> +config.environment['MSAN_SYMBOLIZER_PATH'] = llvm_tools_dir +
> '/llvm-symbolizer'
> Index: test/lit.cfg
> ===================================================================
> --- test/lit.cfg
> +++ test/lit.cfg
> @@ -90,6 +90,11 @@
>  config.environment['PYTHON_EXECUTABLE'] = getattr(config,
> 'python_executable',
>                                                    '')
>
> +# Setup paths to llvm-symbolizer for Sanitizer tools.
> +llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
> +config.environment['ASAN_SYMBOLIZER_PATH'] = llvm_tools_dir +
> '/llvm-symbolizer'
> +config.environment['MSAN_SYMBOLIZER_PATH'] = llvm_tools_dir +
> '/llvm-symbolizer'
> +
>  ###
>
>  import os
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130312/6729f6d6/attachment.html>


More information about the llvm-commits mailing list