-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
sanitizers: Fix tests/ui/sanitize/leak.rs fails on #129621
Conversation
Some changes occurred in tests/ui/sanitizer cc @rust-lang/project-exploit-mitigations, @rcvalle |
r? @tmiasko |
b88d09e
to
cdb1e11
Compare
This comment has been minimized.
This comment has been minimized.
Fix rust-lang#111073 by checking if `-Zexport-executable-symbols` is passed when LeakSanitizer is enabled.
cdb1e11
to
1b04bb8
Compare
Some changes occurred in tests/codegen/sanitizer cc @rust-lang/project-exploit-mitigations, @rcvalle |
@compiler-errors for context: #123617 (comment) |
Can you describe the motivation behind this change? Is it just a workaround for #111073? I think the actual issue is in sanitizer runtime and should be fixed there. In particular the interceptor for For some reason, dynamic loader happens to call |
This would be a fix for Clang linking the sanitizer runtimes with |
With regards to #111073, while From your answer it is still not clear for me if the motivation for this change is limited to #111073 or attempts to replicate clang behavior more generally. If the latter can you describe why is it necessary? What is the problem and how does this change address it? Additionally, this approach introduces dependency on another unstable feature which would block proposed stabilization. |
If the Clang linking the sanitizer runtimes with |
clang exporting sanitizer interface with --dynamic-list makes it possible to load dynamic objects using dlopen that refer to sanitizer interface. The fact that rustc doesn't do that is definitely an issue. At the moment, -Zexport-executable-symbols is no solution for this problem. The current implementation is incomplete - it doesn't add any symbols to dynamic symbol table. It is also unaware of sanitizer interface and so wouldn't export it. To address that problem I would suggest following clang strategy. Add necessary linker flags automatically when sanitizers are enabled (as opposed to requiring end user to enable additional options manually as proposed here). |
Fix #111073 by checking if
-Zexport-executable-symbols
is passed when LeakSanitizer is enabled.