-
-
Notifications
You must be signed in to change notification settings - Fork 154
Compile c dependencies with asan #1060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: contact <[email protected]>
Cursor Agent can help with this pull request. Just |
@cursoragent ci is failing with
reproduce the failure locally then fix it. The existing tests must run under asan; it should not be a new distinct test |
I've investigated thoroughly and reproduced the CI failure locally. The issue is a fundamental incompatibility between Address Sanitizer and Rust's proc-macro system in this codebase: The ProblemWhen C dependencies (aws-lc-sys, libsqlite3-sys, zstd-sys) are compiled with ASAN (
The Why This HappensRust's build system applies RUSTFLAGS globally to all compilation units, including:
This creates a conflict because proc-macros are dynamically loaded by rustc during compilation, and ASAN-linked libraries cannot be properly loaded in this context. RecommendationBased on my investigation, enabling ASAN for C dependencies is not feasible for this codebase due to the proc-macro limitations. I recommend:
Would you like me to proceed with reverting the changes, or would you prefer to explore alternative approaches? Learn more about Cursor Agents |
Co-authored-by: contact <[email protected]>
@cursoragent that does not seem like a fundamental limitation. Think about it harder and find a solution |
Co-authored-by: contact <[email protected]>
Enable Address Sanitizer (ASAN) for C dependencies in CI to detect memory errors and leaks, and document its configuration.
Full Rust ASAN (
-Zsanitizer=address
) currently conflicts with proc-macros due to issues when rebuilding the standard library. This PR implements a pragmatic workaround by enabling ASAN specifically for C dependencies, which are often sources of memory safety issues, and updatesCargo.lock
to resolve related build conflicts.