access violation in __asan::QuickCheckForUnpoisonedRegion and other functions

Dev Stability 17 Reputation points
2023-01-16T07:30:29.2433333+00:00

I have built my dll in release(with pdb) with address sanitizer and copied it to windows server 2016 1607. Also copied
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\bin\Hostx86\x64\clang_rt.asan_dynamic-x86_64.dll to the app folder and launched the app. But get the below exceptions when attached to windbg. Continuing execution throws access violation in another callstack. It continues to throw the exception until app exit. Does not show any asan ERROR report.

(1cbc.1a50): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
clang_rt_asan_dynamic_x86_64!__asan::QuickCheckForUnpoisonedRegion+0x1f:
00007ffe`62b6145f 460fb61408      movzx   r10d,byte ptr [rax+r9] ds:000011ed`1639f000=??

(1cbc.1a50): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
clang_rt_asan_dynamic_x86_64!_asan_region_is_poisoned+0x90:
00007ffe`62b76d60 420fb60401      movzx   eax,byte ptr [rcx+r8] ds:0000043a`f488c000=??

(1cbc.1a50): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
clang_rt_asan_dynamic_x86_64!__asan::QuickCheckForUnpoisonedRegion+0x8e:
00007ffe`62b614ce 460fb61408      movzx   r10d,byte ptr [rax+r9] ds:0000043a`f4946078=??

clang_rt_asan_dynamic_x86_64!__asan::QuickCheckForUnpoisonedRegion:
00007ffe`62b61440 4c8bc1          mov     r8,rcx
00007ffe`62b61443 4885d2          test    rdx,rdx
00007ffe`62b61446 7503            jne     clang_rt_asan_dynamic_x86_64!__asan::QuickCheckForUnpoisonedRegion+0xb (00007ffe`62b6144b)
00007ffe`62b61448 b001            mov     al,1
00007ffe`62b6144a c3              ret
00007ffe`62b6144b 4883fa20        cmp     rdx,20h
00007ffe`62b6144f 7769            ja      clang_rt_asan_dynamic_x86_64!__asan::QuickCheckForUnpoisonedRegion+0x7a (00007ffe`62b614ba)
00007ffe`62b61451 4c8b0d281bb200  mov     r9,qword ptr [clang_rt_asan_dynamic_x86_64!_asan_shadow_memory_dynamic_address (00007ffe`63682f80)]
00007ffe`62b61458 498bc0          mov     rax,r8
00007ffe`62b6145b 48c1e803        shr     rax,3
00007ffe`62b6145f 460fb61408      movzx   r10d,byte ptr [rax+r9]

I built it on VS pro 2022 Version 17.4.4.
Is this a bug in asan or is there some other incompatibility.

Developer technologies | Visual Studio | Debugging
Developer technologies | C++
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YujianYao-MSFT 4,296 Reputation points Microsoft External Staff
    2023-01-17T09:12:21.1633333+00:00

    Hi @Dev Stability

    What will happen if you switch to debug mode?

    According to the prompt of Windbg, there is an access violation. If possible, you could refer to the method in this issue to ignore it.

    Best regards,

    Elya


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.