Skip to content

[ASAN] Shadow memory and tag conflicts in asan report #157604

@Zhenhang1213

Description

@Zhenhang1213

ASAN report:
···
===11416==ERROR: AddressSanitizer: heap-use-after-free on address 0x8b43fe94 at pc 0xb5a2eff4 bp 0xafbfda70 sp 0xafbfda6c
SUMMARY: UndefinedBehaviorSanitizer: heap-use-after-free (***) in ***

Shadow bytes around the buggy address:
0x31687f80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x31687f90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x31687fa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x31687fb0: 00 00 00 00 00 00 00 00 00 04 fa fa fa fa fa fa
0x31687fc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x31687fd0: fa fa[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa
0x31687fe0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x31687ff0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x31688000: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x31688010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x31688020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
···
I found that when the asan report is being printed, there is no locking operation in the framework. At this time, if there is a data race in a multi-threaded environment, this issue of incorrect report printing may occasionally occur.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions