Skip to content

how to compile proc-macro with address sanitizer #142365

Closed
@0xalpharush

Description

@0xalpharush

The unstable book suggest compiling a crate that uses proc-macro's with address sanitizer is possible:

Use of sanitizers together with build scripts and procedural macros is
technically possible, but in almost all cases it would be best avoided. This

But issues like rust-lang/cargo#10666 and the cross-referenced ones run into linker issues and the "fix" was adding --target so the proc-macro wasn't compiled with ASAN.

While a better error would be nice, I am wondering how to resolve linking errors and compile all code under ASAN. I suspect that not doing so is causing a false positive in ASAN when its memory tracking isn't in the proc-macro as well, but maybe my suspicion is misplaced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sanitizersArea: Sanitizers for correctness and code qualityC-discussionCategory: Discussion or questions that doesn't represent real issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions