Skip to content

Strange leak on env::var #41027

Closed
Closed
@lu-zero

Description

@lu-zero

RUSTFLAGS="-Z sanitizer=memory" cargo run

error: failed to run custom build command for `kernel32-sys v0.2.2`
process didn't exit successfully: `/usr/src/rust/x264-rs/target/debug/build/kernel32-sys-9b6c3463a8ee3470/build-script-build` (exit code: 77)
--- stderr
==474==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x55e4231f0f80 in _$LT$core..result..Result$LT$T$C$$u20$E$GT$$GT$::unwrap::hbaca9e4c708f1a9a /checkout/src/libcore/result.rs:736
    #1 0x55e42320a4cb in build::link::h780aaf497d81ebf3 /root/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/winapi-build-0.1.1/src/lib.rs:5
    #2 0x55e4231e8dc7 in build_script_build::main::hfb4f27f7ca8814c9 /root/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/kernel32-sys-0.2.2/build.rs:5
    #3 0x55e423216175 in core::ops::FnOnce::call_once<fn(),()> /checkout/src/libcore/ops.rs:2606
    #4 0x55e423216175 in std::panicking::try::do_call::h689a21caeeef92aa /checkout/src/libstd/panicking.rs:454
    #5 0x55e42329ac0a in __rust_maybe_catch_panic /checkout/src/libpanic_unwind/lib.rs:98
    #6 0x55e42321695a in std::panicking::try<(),fn()> /checkout/src/libstd/panicking.rs:433
    #7 0x55e42321695a in std::panic::catch_unwind<fn(),()> /checkout/src/libstd/panic.rs:361
    #8 0x55e42321695a in std::rt::lang_start::hf63d494cb7dd034c /checkout/src/libstd/rt.rs:57
    #9 0x55e4231e8e39 in main (/usr/src/rust/x264-rs/target/debug/build/kernel32-sys-9b6c3463a8ee3470/build-script-build+0x9e39)
    #10 0x7f7f9fbd7720 in __libc_start_main (/lib64/libc.so.6+0x20720)
    #11 0x55e4231e8c88 in _start (/usr/src/rust/x264-rs/target/debug/build/kernel32-sys-9b6c3463a8ee3470/build-script-build+0x9c88)

SUMMARY: MemorySanitizer: use-of-uninitialized-value /checkout/src/libcore/result.rs:736 in _$LT$core..result..Result$LT$T$C$$u20$E$GT$$GT$::unwrap::hbaca9e4c708f1a9a

All this on linux, using the latest nightly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sanitizersArea: Sanitizers for correctness and code qualityC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions