[PATCH] Set symbolizer path in the test environment

Alexey Samsonov samsonov at google.com
Tue Mar 12 11:22:09 PDT 2013


On Tue, Mar 12, 2013 at 9:27 PM, Daniel Dunbar <daniel at zuster.org> wrote:

> 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?
>

Yep, currently one option is to set env variable, another is to filter the
output through python script. Of course, such user
experience is far from great and we are trying to do better. The latter way
(python script) is fine if you run the program locally, but is worse for
automated testing or build bots.


>
> 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
>>
>
>


-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130312/3b4cd28c/attachment.html>


More information about the llvm-commits mailing list