Skip to content

Add configuration options to enable more sanitizers supported by GCC #148810

@clin1234

Description

@clin1234

Inspired by https://discuss.python.org/t/greater-sanitizer-support-in-ci/106473/2

I wish add the following sanitizers:

  • -fsanitize=hwaddress: augment ASan with an ARM64 CPU feature to ignore the top byte of a pointer to allow the detection of memory errors with a low memory overhead. Memory access instructions are instrumented to detect out-of-bounds and use-after-free bugs. The option enables -fsanitize-address-use-after-scope as well.
  • -fsanitize=memtag-stack: on ARM64 CPUs with Memory Tagging Extension, useful to prevent overhead of instrumentation to allow the detection of memory errors.
  • -fsanitize=pointer-compare and -fsanitize=pointer-subtract: augment ASan by introducing stricter checks on pointer comparisons and other kinds of pointer arithmetic
  • -fsanitize=leak: detect just memory leaks without the full runtime overhead of ASan
  • -fsanitize-address-use-after-scope: sanitize local variables to detect use-after-scope bugs. On GCC, also sets -fstack-reuse to ‘none’.

My main motivation is to add a select few of these additions into CI for more stringent stress-testing of leaks.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions