[cfe-dev] External Symbolizer with ubsan

Will Dietz willdtz at gmail.com
Wed Feb 27 07:05:24 PST 2013


Ubsan uses atomic operations on the SourceLocation for deduplication[1].

One side effect of this is that sanitizer checks without this location
information don't support deduplication and will print multiple times.

Float cast checks have this problem as well, see the TODO's in
ubsan_handlers.cc[2].

~Will

[1] https://github.com/llvm-mirror/compiler-rt/blob/master/lib/ubsan/ubsan_value.h#L67-L72
[2] https://github.com/llvm-mirror/compiler-rt/blob/master/lib/ubsan/ubsan_handlers.cc#L233


On Wed, Feb 27, 2013 at 7:32 AM, Alexey Samsonov <samsonov at google.com> wrote:
>
> On Tue, Feb 26, 2013 at 11:29 PM, Richard Smith <richard at metafoo.co.uk>
> wrote:
>>
>> On Tue, Feb 26, 2013 at 5:45 AM, zapadinsky <zapadinsky at gmail.com> wrote:
>>>
>>> >> I've tried hard to rule it out by myself... but yielded.
>>> >>
>>> >> -fsanitize=enum require an external symbolizer.
>>>
>>> > External symbolizer in UBSan tool is not a requirement, but not fully
>>> > implemented feature. For now, I can add setting external symbolizer for
>>> > ubsan via env
>>> > var if Richard tells that's fine.
>>
>>
>> Thank you, that would be great.
>
>
> Can __ubsan::getCallerLocation() be called from multiple threads?
> I've seen no locks in UBSan runtime, can it be the case that ubsan tries to
> print reports from
> several threads simultaneously?
>
>>
>>
>>>
>>> -fsanitize=integer somehow print the line number and character of an
>>> operator raised an overflow error. Why enum sanitizer needs symbolizer?
>>> There was an idea to print the stack trace?
>>
>>
>> Two things: firstly, ubsan can't currently determine the source location
>> for all checks at build time; for a few, we work out the location based on
>> return address at runtime. That's just due to incomplete implementation.
>> Secondly, as you suspect, we want to include a stack trace eventually.
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>
>
>
> --
> Alexey Samsonov, MSK
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list