Skip to content

uninitialized value in nightly build with memory sanitizer #391

@Byter09

Description

@Byter09

I'm currently fuzzing https://github.com/jyn514/rcc and noticed some totally unrelated crashes (they're stack overflows).

In the process however I wanted to change my script that runs the latest crash files to use a nightly and sanitized version of rcc. When using -Zsanitizer=memory compilation failed. At first it showed backtrace-sys with the warning use-of-uninitialized-value, however when testing that locally again, it showed log instead.

So I went ahead, downloaded log and ran:
RUSTFLAGS="-Awarnings -Zsanitizer=memory" cargo +nightly build.

This is the output:

   Compiling log v0.4.10 (/home/btr/Projects/clion/log)
   Compiling cfg-if v0.1.10
error: failed to run custom build command for `log v0.4.10 (/home/btr/Projects/clion/log)`

Caused by:
  process didn't exit successfully: `/home/btr/Projects/clion/log/target/debug/build/log-c3142b51c95ab84c/build-script-build` (exit code: 77)
--- stderr
==37637==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x5619ff54b846  (/home/btr/Projects/clion/log/target/debug/build/log-c3142b51c95ab84c/build-script-build+0x6b846)
    #1 0x5619ff54af6b  (/home/btr/Projects/clion/log/target/debug/build/log-c3142b51c95ab84c/build-script-build+0x6af6b)
    #2 0x5619ff54a985  (/home/btr/Projects/clion/log/target/debug/build/log-c3142b51c95ab84c/build-script-build+0x6a985)
    #3 0x5619ff555b17  (/home/btr/Projects/clion/log/target/debug/build/log-c3142b51c95ab84c/build-script-build+0x75b17)
    #4 0x5619ff54a8cb  (/home/btr/Projects/clion/log/target/debug/build/log-c3142b51c95ab84c/build-script-build+0x6a8cb)
    #5 0x5619ff54b2d1  (/home/btr/Projects/clion/log/target/debug/build/log-c3142b51c95ab84c/build-script-build+0x6b2d1)
    #6 0x7f35497e6022  (/usr/lib/libc.so.6+0x27022)
    #7 0x5619ff4eb1ed  (/home/btr/Projects/clion/log/target/debug/build/log-c3142b51c95ab84c/build-script-build+0xb1ed)

SUMMARY: MemorySanitizer: use-of-uninitialized-value (/home/btr/Projects/clion/log/target/debug/build/log-c3142b51c95ab84c/build-script-build+0x6b846) 
Exiting

This is not really my area of expertise so I hope you nice people know what to do with this.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions