Bug: Building FF and/or JS with MSAN fails with "WARNING: MemorySanitizer: use-of-uninitialized-value"
Status: RESOLVED
Priority: --
Resolution: INVALID
Created: 2021-11-06 19:04:08+00:00
Resolved: 2021-11-09 02:29:55+00:00

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36

Steps to reproduce:

Following the steps, including the MOZCONFIG listed on this page https://firefox-source-docs.mozilla.org/tools/sanitizer/memory_sanitizer.html,  FF and/or JS(with --enable-application=js)  fail to build due to MSAN WARNING. See below.


Actual results:

 0:57.75 error: failed to run custom build command for `proc-macro2 v1.0.27`
 0:57.75 Caused by:
 0:57.75   process didn't exit successfully: `/home/dev/mozilla-unified/obj-msan-opt-x86_64-pc-linux-gnu/release/build/proc-macro2-49b9ecac773b4a4d/build-script-build` (exit status: 1)
 0:57.75   --- stderr
 0:57.75   Uninitialized bytes in __interceptor_memchr at offset 0 inside [0x701000000000, 4)
 0:57.75   ==203380==WARNING: MemorySanitizer: use-of-uninitialized-value
 0:57.75       #0 0x556c9b9ea440 in std::sys::unix::memchr::memchr::he246e7bc08bcba4b /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys/unix/memchr.rs:6:9
 0:57.75       #1 0x556c9b9ea440 in std::sys_common::memchr::memchr::he3ee2a5a45e66b9e /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/memchr.rs:30:5
 0:57.75       #2 0x556c9b9ea440 in std::ffi::c_str::CString::_new::hbfd1e7559c9eedf0 /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/ffi/c_str.rs:404:15
 0:57.75       #3 0x556c9b9ea440 in std::ffi::c_str::CString::new::hef86407ee53695cc /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/ffi/c_str.rs:400:9
 0:57.75       #4 0x556c9b9ea440 in std::thread::Thread::new::_$u7b$$u7b$closure$u7d$$u7d$::hd2de364d92a6de15 /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/thread/mod.rs:1078:26
 0:57.75       #5 0x556c9b9ea440 in core::option::Option$LT$T$GT$::map::hc804dcd034bb5c4c /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/option.rs:836:29
 0:57.75       #6 0x556c9b9ea440 in std::thread::Thread::new::he9d3b71339622625 /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/thread/mod.rs:1078:13
 0:57.75       #7 0x556c9ba0bfc5 in std::sys_common::rt::init::h61a5ea52bfc88589 /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/rt.rs:23:22
 0:57.75       #8 0x556c9ba0bfc5 in std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::hefdd02657047db04 /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/rt.rs:44:42
 0:57.75       #9 0x556c9ba0bfc5 in std::panicking::try::do_call::h5fb2052f171ab568 /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:403:40
 0:57.75       #10 0x556c9ba0bfc5 in std::panicking::try::h1cd1c1e14102980f /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:367:19
 0:57.75       #11 0x556c9ba0bfc5 in std::panic::catch_unwind::h4ac4d60eeb32a981 /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panic.rs:129:14
 0:57.75       #12 0x556c9ba0bfc5 in std::rt::lang_start_internal::hdd488b91dc742b96 /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/rt.rs:44:5
 0:57.75       #13 0x556c9b9ce60a in std::rt::lang_start::h970e1d0b4cae82ee (/home/dev/mozilla-unified/obj-msan-opt-x86_64-pc-linux-gnu/release/build/proc-macro2-49b9ecac773b4a4d/build-script-build+0x16260a)
 0:57.75       #14 0x556c9b9cd902 in main (/home/dev/mozilla-unified/obj-msan-opt-x86_64-pc-linux-gnu/release/build/proc-macro2-49b9ecac773b4a4d/build-script-build+0x161902)
 0:57.76       #15 0x7f4bf5a390b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
 0:57.76       #16 0x556c9b956d88 in _start (/home/dev/mozilla-unified/obj-msan-opt-x86_64-pc-linux-gnu/release/build/proc-macro2-49b9ecac773b4a4d/build-script-build+0xead88)
 0:57.76   SUMMARY: MemorySanitizer: use-of-uninitialized-value /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys/unix/memchr.rs:6:9 in std::sys::unix::memchr::memchr::he246e7bc08bcba4b
 0:57.76   Exiting


Expected results:

Expected results is to have ff/js instrumented with MSAN.