nix icon indicating copy to clipboard operation
nix copied to clipboard

Potential Uninitialized Memory Read in `InterfaceAddress` from `InterfaceAddressIterator

Open quitbug opened this issue 8 months ago • 1 comments
trafficstars

Hi, I've found a memory issue in this crate for potential vulnerabilities. It seems that the InterfaceAddress object produced by the InterfaceAddressIterator may lead to reading from uninitialized memory. This could potentially cause undefined behavior or potential vulnerabilities.

To Reproduce Steps to reproduce the behavior:

  1. nix-0.29.0 on ubuntu 20.04
  2. run the below test case.
fn test_unit_read() {
    let mut addrs = getifaddrs().unwrap();
    let iface = addrs.next().unwrap();
    println!("{:?}", iface.address);
}

run the valgrind and its output is below:

==583716== Command: target/debug/test1
==583716==
==583716== Conditional jump or move depends on uninitialised value(s)
==583716==    at 0x15219A: fmt_u64 (num.rs:234)
==583716==    by 0x15219A: core::fmt::num::imp::<impl core::fmt::Display for u64>::fmt (num.rs:291)
==583716==    by 0x116569: core::fmt::num::<impl core::fmt::Debug for usize>::fmt (num.rs:195)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x11660E: <libc::unix::linux_like::sockaddr_storage as core::fmt::Debug>::fmt (mod.rs:371)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x1121DA: <nix::sys::socket::addr::SockaddrStorage as core::fmt::Debug>::fmt (addr.rs:1369)
==583716==    by 0x111876: <&T as core::fmt::Debug>::fmt (mod.rs:2333)
==583716==    by 0x14E800: {closure#0} (builders.rs:330)
==583716==    by 0x14E800: {closure#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:355)
==583716==    by 0x14E800: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#4}::field_with::{closure_env#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E800: field_with<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:342)
==583716==    by 0x14E800: core::fmt::builders::DebugTuple::field (builders.rs:330)
==583716==    by 0x14F46A: core::fmt::Formatter::debug_tuple_field1_finish (mod.rs:2095)
==583716==    by 0x1119AD: <core::option::Option<T> as core::fmt::Debug>::fmt (option.rs:567)
==583716==    by 0x14EC3B: fmt (rt.rs:142)
==583716==    by 0x14EC3B: core::fmt::write (mod.rs:1153)
==583716==    by 0x12E10A: write_fmt<std::io::stdio::StdoutLock> (mod.rs:1843)
==583716==    by 0x12E10A: <&std::io::stdio::Stdout as std::io::Write>::write_fmt (stdio.rs:776)
==583716==
==583716== Use of uninitialised value of size 8
==583716==    at 0x1521E0: copy_nonoverlapping<u8> (intrinsics.rs:2987)
==583716==    by 0x1521E0: fmt_u64 (num.rs:245)
==583716==    by 0x1521E0: core::fmt::num::imp::<impl core::fmt::Display for u64>::fmt (num.rs:291)
==583716==    by 0x116569: core::fmt::num::<impl core::fmt::Debug for usize>::fmt (num.rs:195)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x11660E: <libc::unix::linux_like::sockaddr_storage as core::fmt::Debug>::fmt (mod.rs:371)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x1121DA: <nix::sys::socket::addr::SockaddrStorage as core::fmt::Debug>::fmt (addr.rs:1369)
==583716==    by 0x111876: <&T as core::fmt::Debug>::fmt (mod.rs:2333)
==583716==    by 0x14E800: {closure#0} (builders.rs:330)
==583716==    by 0x14E800: {closure#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:355)
==583716==    by 0x14E800: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#4}::field_with::{closure_env#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E800: field_with<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:342)
==583716==    by 0x14E800: core::fmt::builders::DebugTuple::field (builders.rs:330)
==583716==    by 0x14F46A: core::fmt::Formatter::debug_tuple_field1_finish (mod.rs:2095)
==583716==    by 0x1119AD: <core::option::Option<T> as core::fmt::Debug>::fmt (option.rs:567)
==583716==    by 0x14EC3B: fmt (rt.rs:142)
==583716==    by 0x14EC3B: core::fmt::write (mod.rs:1153)
==583716==    by 0x12E10A: write_fmt<std::io::stdio::StdoutLock> (mod.rs:1843)
==583716==    by 0x12E10A: <&std::io::stdio::Stdout as std::io::Write>::write_fmt (stdio.rs:776)
==583716==
==583716== Use of uninitialised value of size 8
==583716==    at 0x1521EB: copy_nonoverlapping<u8> (intrinsics.rs:2987)
==583716==    by 0x1521EB: fmt_u64 (num.rs:246)
==583716==    by 0x1521EB: core::fmt::num::imp::<impl core::fmt::Display for u64>::fmt (num.rs:291)
==583716==    by 0x116569: core::fmt::num::<impl core::fmt::Debug for usize>::fmt (num.rs:195)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x11660E: <libc::unix::linux_like::sockaddr_storage as core::fmt::Debug>::fmt (mod.rs:371)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x1121DA: <nix::sys::socket::addr::SockaddrStorage as core::fmt::Debug>::fmt (addr.rs:1369)
==583716==    by 0x111876: <&T as core::fmt::Debug>::fmt (mod.rs:2333)
==583716==    by 0x14E800: {closure#0} (builders.rs:330)
==583716==    by 0x14E800: {closure#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:355)
==583716==    by 0x14E800: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#4}::field_with::{closure_env#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E800: field_with<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:342)
==583716==    by 0x14E800: core::fmt::builders::DebugTuple::field (builders.rs:330)
==583716==    by 0x14F46A: core::fmt::Formatter::debug_tuple_field1_finish (mod.rs:2095)
==583716==    by 0x1119AD: <core::option::Option<T> as core::fmt::Debug>::fmt (option.rs:567)
==583716==    by 0x14EC3B: fmt (rt.rs:142)
==583716==    by 0x14EC3B: core::fmt::write (mod.rs:1153)
==583716==    by 0x12E10A: write_fmt<std::io::stdio::StdoutLock> (mod.rs:1843)
==583716==    by 0x12E10A: <&std::io::stdio::Stdout as std::io::Write>::write_fmt (stdio.rs:776)
==583716==
==583716== Conditional jump or move depends on uninitialised value(s)
==583716==    at 0x152203: fmt_u64 (num.rs:234)
==583716==    by 0x152203: core::fmt::num::imp::<impl core::fmt::Display for u64>::fmt (num.rs:291)
==583716==    by 0x116569: core::fmt::num::<impl core::fmt::Debug for usize>::fmt (num.rs:195)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x11660E: <libc::unix::linux_like::sockaddr_storage as core::fmt::Debug>::fmt (mod.rs:371)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x1121DA: <nix::sys::socket::addr::SockaddrStorage as core::fmt::Debug>::fmt (addr.rs:1369)
==583716==    by 0x111876: <&T as core::fmt::Debug>::fmt (mod.rs:2333)
==583716==    by 0x14E800: {closure#0} (builders.rs:330)
==583716==    by 0x14E800: {closure#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:355)
==583716==    by 0x14E800: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#4}::field_with::{closure_env#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E800: field_with<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:342)
==583716==    by 0x14E800: core::fmt::builders::DebugTuple::field (builders.rs:330)
==583716==    by 0x14F46A: core::fmt::Formatter::debug_tuple_field1_finish (mod.rs:2095)
==583716==    by 0x1119AD: <core::option::Option<T> as core::fmt::Debug>::fmt (option.rs:567)
==583716==    by 0x14EC3B: fmt (rt.rs:142)
==583716==    by 0x14EC3B: core::fmt::write (mod.rs:1153)
==583716==    by 0x12E10A: write_fmt<std::io::stdio::StdoutLock> (mod.rs:1843)
==583716==    by 0x12E10A: <&std::io::stdio::Stdout as std::io::Write>::write_fmt (stdio.rs:776)
==583716==
==583716== Conditional jump or move depends on uninitialised value(s)
==583716==    at 0x152209: fmt_u64 (num.rs:253)
==583716==    by 0x152209: core::fmt::num::imp::<impl core::fmt::Display for u64>::fmt (num.rs:291)
==583716==    by 0x116569: core::fmt::num::<impl core::fmt::Debug for usize>::fmt (num.rs:195)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x11660E: <libc::unix::linux_like::sockaddr_storage as core::fmt::Debug>::fmt (mod.rs:371)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x1121DA: <nix::sys::socket::addr::SockaddrStorage as core::fmt::Debug>::fmt (addr.rs:1369)
==583716==    by 0x111876: <&T as core::fmt::Debug>::fmt (mod.rs:2333)
==583716==    by 0x14E800: {closure#0} (builders.rs:330)
==583716==    by 0x14E800: {closure#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:355)
==583716==    by 0x14E800: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#4}::field_with::{closure_env#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E800: field_with<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:342)
==583716==    by 0x14E800: core::fmt::builders::DebugTuple::field (builders.rs:330)
==583716==    by 0x14F46A: core::fmt::Formatter::debug_tuple_field1_finish (mod.rs:2095)
==583716==    by 0x1119AD: <core::option::Option<T> as core::fmt::Debug>::fmt (option.rs:567)
==583716==    by 0x14EC3B: fmt (rt.rs:142)
==583716==    by 0x14EC3B: core::fmt::write (mod.rs:1153)
==583716==    by 0x12E10A: write_fmt<std::io::stdio::StdoutLock> (mod.rs:1843)
==583716==    by 0x12E10A: <&std::io::stdio::Stdout as std::io::Write>::write_fmt (stdio.rs:776)
==583716==
==583716== Conditional jump or move depends on uninitialised value(s)
==583716==    at 0x152238: fmt_u64 (num.rs:261)
==583716==    by 0x152238: core::fmt::num::imp::<impl core::fmt::Display for u64>::fmt (num.rs:291)
==583716==    by 0x116569: core::fmt::num::<impl core::fmt::Debug for usize>::fmt (num.rs:195)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x11660E: <libc::unix::linux_like::sockaddr_storage as core::fmt::Debug>::fmt (mod.rs:371)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x1121DA: <nix::sys::socket::addr::SockaddrStorage as core::fmt::Debug>::fmt (addr.rs:1369)
==583716==    by 0x111876: <&T as core::fmt::Debug>::fmt (mod.rs:2333)
==583716==    by 0x14E800: {closure#0} (builders.rs:330)
==583716==    by 0x14E800: {closure#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:355)
==583716==    by 0x14E800: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#4}::field_with::{closure_env#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E800: field_with<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:342)
==583716==    by 0x14E800: core::fmt::builders::DebugTuple::field (builders.rs:330)
==583716==    by 0x14F46A: core::fmt::Formatter::debug_tuple_field1_finish (mod.rs:2095)
==583716==    by 0x1119AD: <core::option::Option<T> as core::fmt::Debug>::fmt (option.rs:567)
==583716==    by 0x14EC3B: fmt (rt.rs:142)
==583716==    by 0x14EC3B: core::fmt::write (mod.rs:1153)
==583716==    by 0x12E10A: write_fmt<std::io::stdio::StdoutLock> (mod.rs:1843)
==583716==    by 0x12E10A: <&std::io::stdio::Stdout as std::io::Write>::write_fmt (stdio.rs:776)
==583716==
==583716== Use of uninitialised value of size 8
==583716==    at 0x152250: copy_nonoverlapping<u8> (intrinsics.rs:2987)
==583716==    by 0x152250: fmt_u64 (num.rs:267)
==583716==    by 0x152250: core::fmt::num::imp::<impl core::fmt::Display for u64>::fmt (num.rs:291)
==583716==    by 0x116569: core::fmt::num::<impl core::fmt::Debug for usize>::fmt (num.rs:195)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x11660E: <libc::unix::linux_like::sockaddr_storage as core::fmt::Debug>::fmt (mod.rs:371)
==583716==    by 0x14E621: {closure#0} (builders.rs:133)
==583716==    by 0x14E621: {closure#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:162)
==583716==    by 0x14E621: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#3}::field_with::{closure_env#0}<core::fmt::builders::{impl#3}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E621: field_with<core::fmt::builders::{impl#3}::field::{closure_env#0}> (builders.rs:145)
==583716==    by 0x14E621: core::fmt::builders::DebugStruct::field (builders.rs:133)
==583716==    by 0x1121DA: <nix::sys::socket::addr::SockaddrStorage as core::fmt::Debug>::fmt (addr.rs:1369)
==583716==    by 0x111876: <&T as core::fmt::Debug>::fmt (mod.rs:2333)
==583716==    by 0x14E800: {closure#0} (builders.rs:330)
==583716==    by 0x14E800: {closure#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:355)
==583716==    by 0x14E800: and_then<(), core::fmt::Error, (), core::fmt::builders::{impl#4}::field_with::{closure_env#0}<core::fmt::builders::{impl#4}::field::{closure_env#0}>> (result.rs:1321)
==583716==    by 0x14E800: field_with<core::fmt::builders::{impl#4}::field::{closure_env#0}> (builders.rs:342)
==583716==    by 0x14E800: core::fmt::builders::DebugTuple::field (builders.rs:330)
==583716==    by 0x14F46A: core::fmt::Formatter::debug_tuple_field1_finish (mod.rs:2095)
==583716==    by 0x1119AD: <core::option::Option<T> as core::fmt::Debug>::fmt (option.rs:567)
==583716==    by 0x14EC3B: fmt (rt.rs:142)
==583716==    by 0x14EC3B: core::fmt::write (mod.rs:1153)
==583716==    by 0x12E10A: write_fmt<std::io::stdio::StdoutLock> (mod.rs:1843)
==583716==    by 0x12E10A: <&std::io::stdio::Stdout as std::io::Write>::write_fmt (stdio.rs:776)
==583716==
Some(SockaddrStorage { ss: sockaddr_storage { ss_family: 17, __ss_align: 432348879942320129 } })
==583716==
==583716== HEAP SUMMARY:
==583716==     in use at exit: 0 bytes in 0 blocks
==583716==   total heap usage: 20 allocs, 20 frees, 22,523 bytes allocated
==583716==
==583716== All heap blocks were freed -- no leaks are possible
==583716==
==583716== Use --track-origins=yes to see where uninitialised values come from
==583716== For lists of detected and suppressed errors, rerun with: -s
==583716== ERROR SUMMARY: 16 errors from 7 contexts (suppressed: 0 from 0)

quitbug avatar Mar 04 '25 13:03 quitbug

I tried to debug the root cause, and it seems to be at line 1908 in this method.

https://github.com/nix-rust/nix/blob/e4895d34d9e92b6d5693a7959bd5ef8bc98b53ba/src/sys/socket/addr.rs#L1895-L1910

quitbug avatar Mar 04 '25 13:03 quitbug