Skip to content
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

AddressSanitizer: odr-violation with zero size #41807

Closed
ishitatsuyuki opened this issue May 7, 2017 · 3 comments
Closed

AddressSanitizer: odr-violation with zero size #41807

ishitatsuyuki opened this issue May 7, 2017 · 3 comments
Labels
A-sanitizers Area: Sanitizers for correctness and code quality. C-bug Category: This is a bug.

Comments

@ishitatsuyuki
Copy link
Contributor

   Compiling libz-sys v1.0.13 (file:///tmp/libz-sys)
error: failed to run custom build command for `libz-sys v1.0.13 (file:///tmp/libz-sys)`
process didn't exit successfully: `/tmp/libz-sys/target/debug/build/libz-sys-adcfdad3f52dba5a/build-script-build` (exit code: 1)
--- stderr
=================================================================
==3839==ERROR: AddressSanitizer: odr-violation (0x5604022c8b20):
  [1] size=0 'ref.x' pkg_config.rs
  [2] size=0 'ref.d' build_script_build.rs
These globals were registered at these points:
  [1]:
    #0 0x5604021f2130 in __asan_register_globals.part.11 /build/src/rust/src/compiler-rt/lib/asan/asan_globals.cc:338
    #1 0x5604020a3bad in asan.module_ctor (/tmp/libz-sys/target/debug/build/libz-sys-adcfdad3f52dba5a/build-script-build+0xc0bad)

  [2]:
    #0 0x5604021f2130 in __asan_register_globals.part.11 /build/src/rust/src/compiler-rt/lib/asan/asan_globals.cc:338
    #1 0x56040202420d in asan.module_ctor (/tmp/libz-sys/target/debug/build/libz-sys-adcfdad3f52dba5a/build-script-build+0x4120d)

==3839==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global 'ref.x' at pkg_config.rs
==3839==ABORTING

As you can see, they are both 0 sized, which means this is some kind of internally generated code.

rustc 1.19.0-dev (5d0865315 2017-05-03)
binary: rustc
commit-hash: 5d0865315b0f46546db298f7bcdaa713cf20e11a
commit-date: 2017-05-03
host: x86_64-unknown-linux-gnu
release: 1.19.0-dev
LLVM version: 4.0
@dwrensha
Copy link
Contributor

dwrensha commented May 8, 2017

Related cargo-fuzz pull request: rust-fuzz/cargo-fuzz#32

@Shnatsel
Copy link
Member

Shnatsel commented Oct 9, 2019

This can be worked around by disabling the ODR violation check, as seen here: https://github.com/image-rs/image-png/blob/edcf8b07a355159fe69248aeb757cc48f212cf41/png-afl/src/main.rs#L5-L11

@tmiasko
Copy link
Contributor

tmiasko commented Aug 29, 2020

Is this still an issue? Could you provide updated reproduction steps?

@tmiasko tmiasko closed this as completed Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sanitizers Area: Sanitizers for correctness and code quality. C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

5 participants