Skip to content

Write to zero page memory detected by Clang ASAN on Windows #191

@degski

Description

@degski
=================================================================
==14896==ERROR: AddressSanitizer: access-violation on unknown address 0x000000000008 (pc 0x7ff656cd294a bp 0x00f0d6ddf710 sp 0x00f0d6ddf660 T0)
==14896==The signal is caused by a WRITE memory access.
==14896==Hint: address points to the zero page.
    #0 0x7ff656cd2949  (Y:\REPOS\compact_vector\x64\Release\compact_vector.exe+0x140002949)
    #1 0x7ff656d1728f in __ubsan_get_current_report_data (Y:\REPOS\compact_vector\x64\Release\compact_vector.exe+0x14004728f)
    #2 0x7ff9a1a67bd3  (C:\WINDOWS\System32\KERNEL32.DLL+0x180017bd3)
    #3 0x7ff9a3a0ced0  (C:\WINDOWS\SYSTEM32\ntdll.dll+0x18006ced0)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: access-violation (Y:\REPOS\compact_vector\x64\Release\compact_vector.exe+0x140002949)
==14896==ABORTING
Press any key to continue . . .

Clang-10 (https://llvm.org/builds/) and VS 16.4.2 on Windows 10.18363 (x64).

To reproduce, compile (and run) any program that mi_malloc/mi_free's, while enabling ASAN.
Pass flag

-fsanitize=address

to the compiler and link to:

C:\Program Files\LLVM\lib\clang\10.0.0\lib\windows\clang_rt.asan_cxx-x86_64.lib
C:\Program Files\LLVM\lib\clang\10.0.0\lib\windows\clang_rt.asan-preinit-x86_64.lib
C:\Program Files\LLVM\lib\clang\10.0.0\lib\windows\clang_rt.asan-x86_64.lib

in RELEASE mode (only).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions