byronknoll / cmix

cmix is a lossless data compression program aimed at optimizing compression ratio at the cost of high CPU/memory usage.
http://www.byronknoll.com/cmix.html
GNU General Public License v3.0
601 stars 44 forks source link

[BUG]: ERROR Uninitialized bytes #55

Open SophrosyneX opened 1 year ago

SophrosyneX commented 1 year ago

Crash Inputs

Here is the crash file that trigger the error cmix_msan_crash_Uninitialized_bytes.zip

Bug Description:

When executing cmix (new release version) with the file inputs and parameter "-n", the MSan (Memory Sanitizer ) instrumented program terminates with Nonfatal Error shown below.

Uninitialized bytes in __interceptor_fopen at offset 53 inside [0x704000000000, 54)
==118027==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x663d28 in RunCompression(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, _IO_FILE*, unsigned long long*, unsigned long long*) /cmix/src/runner.cpp:162:19
    #1 0x667114 in main /cmix/src/runner.cpp:298:10
    #2 0x7efc182d1c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
    #3 0x420669 in _start (/cmix/cmix_msan+0x420669)

SUMMARY: MemorySanitizer: use-of-uninitialized-value /cmix/src/runner.cpp:162:19 in RunCompression(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, _IO_FILE*, unsigned long long*, unsigned long long*)
Exiting

Step to reproduce