Should I worry about one rule violation in the Rust executable reported by ASAN?

I have a Rust executable that was compiled exclusively within the Rust ecosystem; no external C code or linked libraries, without using a compiler.

After compiling with ASAN on Linux, ASAN reports one rule violation (ODR). Should I worry about the correctness of my executable? What are some common problems? What are some corner cases?

I understand that since all my Rust dependencies were compiled before .rlib s, and because none of my codes are in a foreign language, and since none of my codes explicitly refers to foreign libraries, the compiler should have known everyone of my program symbol names at compile time, with the possible exception of the system libraries that it drags on its own and therefore should be in the know. Thus, I tend to ignore the ODR violation as "I can do nothing about it."

I cannot reproduce this example with minimal reproduction, and I just need an answer that gives me enough to determine if I need to take care of this.

The command I used to build / run using ASAN:

 CARGO_INCREMENTAL=0 RUSTFLAGS="-Z sanitizer=address" cargo run --target x86_64-unknown-linux-gnu --example name_of_example 

Error message (with deleted executable file name and file)

 ==18003==ERROR: AddressSanitizer: odr-violation (0x5625fb39f760): [1] size=0 'ref.c' executable_name_here12-d0d02bd82d5d1b2688ff68a1707ea7a1.rs [2] size=0 'ref.l' executable_name_here10-d0d02bd82d5d1b2688ff68a1707ea7a1.rs These globals were registered at these points: [1]: #0 0x5625fb2a5727 in __asan_register_globals.part.11 /checkout/src/libcompiler_builtins/compiler-rt/lib/asan/asan_globals.cc:338 #1 0x5625faf4e26d in asan.module_ctor (/executable/path/here+0x1c326d) [2]: #0 0x5625fb2a5727 in __asan_register_globals.part.11 /checkout/src/libcompiler_builtins/compiler-rt/lib/asan/asan_globals.cc:338 #1 0x5625fae9d9cd in asan.module_ctor (/executable/path/here+0x1129cd) 

As far as I can tell, this is not from my mailboxes (and I don’t observe any bad behavior, therefore, I tend to not care), but I have a few interdependent mailboxes that are substituted here, and I'm not sure if this can reflect another sinister issue.

+8
rust one-definition-rule
source share

No one has answered this question yet.

See related questions:

7
Why does the Rust compiler generate huge executables?
5
One rule for defining a member access expression
4
Does a function in the standard library override one definition rule?
3
How can I make Cargo build the script and use the link-specific object at the same time?
2
Does "__DATE__" or "__TIME__" use a single definition violation?
2
Violation of one definition rule by simple binding dynamically
one
Should Rust implementations of / TryFrom have target links or values?
one
Am I injecting IntoIterator incorrectly for reference, or is it a Rust error that should be reported?
one
C ++ confusion regarding one definition rule
0
A bit of misunderstanding regarding the used odr definition

All Articles