On Thu, Apr 20, 2017 at 10:20 AM, 'Dmitry Vyukov' via
address-sanitizer <
address-...@googlegroups.com> wrote:
> On Thu, Apr 20, 2017 at 11:11 AM, evgeny777 <
evgeny....@gmail.com> wrote:
>> Thanks for clarifying it, Dmitry.
>>
>> Here is piece of report I get:
>>
>> ==18244==ERROR: AddressSanitizer: heap-buffer-overflow on address
>> 0x60200000001a at pc 0x0000005a9cad bp 0x7ffc10528760 sp 0x7ffc10528740
>> WRITE of size 1 at 0x60200000001a thread T0
>> #0 0x5a9cac (/home/evgeny/work/linker_scripts/asan/asan+0x5a9cac)
>> #1 0x7f310488082f (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
>> #2 0x419498 (/home/evgeny/work/linker_scripts/asan/asan+0x419498)
>>
>> ....
>>
>> Below is the piece of disassembly of main :
>>
>> .....
>> 0x5a9ca8 <+136>: callq 0x56d9d0 ;
>> ::__asan_report_store1(__sanitizer::uptr) at asan_rtl.cc:136
>> 0x5a9cad <+141>: xorl %eax, %eax
>> .....
>>
>> As you may noticed 0x5a9cac == (0x5a9cad - 1)
>
>
> I think tsan prints unmodified PC and we should do the same in asan.
> This also reliefs us from figuring out correct instruction length on
> ARM/thumb/etc as nobody sees the modified PC.