You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This test icmp and auto-discovers the src IP address.
Fails with Attempt to use a closed SOCKET from trippy_core::net::platform::windows::routing_interface_query, which is called at startup to auto-discover the src IP address.
This test icmp and validate the provided src IP address.
Fails with Attempt to use a closed SOCKET from trippy_core::net::source::SourceAddr::validate which is called at startup to validate the provided IP address.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<avrf:logfilexmlns:avrf="Application Verifier">
<avrf:logSessionTimeStarted="2024-12-21 : 20:14:11"PID="13048"Version="2">
<avrf:logEntryTime="2024-12-21 : 20:14:12"LayerName="Networking"StopCode="0xE101"Severity="Error">
<avrf:message>Attempt to use a closed SOCKET</avrf:message>
<avrf:parameter1>328 - SOCKET being accessed</avrf:parameter1>
<avrf:parameter2>21646b11ec0 - Stack trace of the function that closed the SOCKET. Use dps to dump the stack trace if not NULL</avrf:parameter2>
<avrf:parameter3>0 - Not used</avrf:parameter3>
<avrf:parameter4>0 - Not used</avrf:parameter4>
<avrf:stackTrace>
<avrf:trace>vfnet!+7ffa21bf3567 ( @ 0)</avrf:trace>
<avrf:trace>vfnet!+7ffa21bf795a ( @ 0)</avrf:trace>
<avrf:trace>trip!trippy_core::net::platform::windows::impl$3::close+63f (C:\Users\vboxuser\code\trippy\crates\trippy-core\src\net\platform\windows.rs @ 36)</avrf:trace>
<avrf:trace>trip!trippy_core::net::platform::windows::impl$2::drop+21 (C:\Users\vboxuser\code\trippy\crates\trippy-core\src\net\platform\windows.rs @ 286)</avrf:trace>
<avrf:trace>trip!core::ptr::drop_in_place<trippy_core::net::platform::windows::SocketImpl>+1f (C:\Users\vboxuser\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs @ 574)</avrf:trace>
<avrf:trace>trip!trippy_core::net::source::SourceAddr::validate<trippy_core::net::platform::windows::SocketImpl>+232 (C:\Users\vboxuser\code\trippy\crates\trippy-core\src\net\source.rs @ 43)</avrf:trace>
<avrf:trace>trip!trippy_core::tracer::inner::TracerInner::run_internal<trippy_core::tracer::inner::impl$0::run::closure_env$0>+6d9 (C:\Users\vboxuser\code\trippy\crates\trippy-core\src\tracer.rs @ 658)</avrf:trace>
<avrf:trace>trip!trippy_core::tracer::inner::TracerInner::run+ba (C:\Users\vboxuser\code\trippy\crates\trippy-core\src\tracer.rs @ 533)</avrf:trace>
<avrf:trace>trip!trippy_core::tracer::Tracer::run+32 (C:\Users\vboxuser\code\trippy\crates\trippy-core\src\tracer.rs @ 127)</avrf:trace>
<avrf:trace>trip!trippy_core::tracer::impl$0::spawn::closure$0+26 (C:\Users\vboxuser\code\trippy\crates\trippy-core\src\tracer.rs @ 211)</avrf:trace>
<avrf:trace>trip!std::sys::backtrace::__rust_begin_short_backtrace<trippy_core::tracer::impl$0::spawn::closure_env$0,enum2$<core::result::Result<tuple$<>,enum2$<trippy_core::error::Error>>>>+16 (C:\Users\vboxuser\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys\backtrace.rs @ 154)</avrf:trace>
<avrf:trace>trip!std::thread::impl$0::spawn_unchecked_::closure$1::closure$0<trippy_core::tracer::impl$0::spawn::closure_env$0,enum2$<core::result::Result<tuple$<>,enum2$<trippy_core::error::Error>>>>+16 (C:\Users\vboxuser\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs @ 538)</avrf:trace>
<avrf:trace>trip!core::panic::unwind_safe::impl$25::call_once<enum2$<core::result::Result<tuple$<>,enum2$<trippy_core::error::Error>>>,std::thread::impl$0::spawn_unchecked_::closure$1::closure_env$0<trippy_core::tracer::impl$0::spawn::closure_env$0,enum2$<core::res (C:\Users\vboxuser\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\panic\unwind_safe.rs @ 272)</avrf:trace>
<avrf:trace>trip!std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::impl$0::spawn_unchecked_::closure$1::closure_env$0<trippy_core::tracer::impl$0::spawn::closure_env$0,enum2$<core::result::Result<tuple$<>,enum2$<trippy_core::error:: (C:\Users\vboxuser\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs @ 557)</avrf:trace>
<avrf:trace>trip!std::thread::impl$7::drop::closure$0<enum2$<core::result::Result<tuple$<>,enum2$<trippy_core::error::Error>>>>+c3 ( @ 0)</avrf:trace>
<avrf:trace>trip!std::thread::impl$0::spawn_unchecked_::closure$1<trippy_core::tracer::impl$0::spawn::closure_env$0,enum2$<core::result::Result<tuple$<>,enum2$<trippy_core::error::Error>>>>+331 (C:\Users\vboxuser\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs @ 537)</avrf:trace>
<avrf:trace>trip!core::ops::function::FnOnce::call_once<std::thread::impl$0::spawn_unchecked_::closure_env$1<trippy_core::tracer::impl$0::spawn::closure_env$0,enum2$<core::result::Result<tuple$<>,enum2$<trippy_core::error::Error>>>>,tuple$<>>+e (C:\Users\vboxuser\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs @ 250)</avrf:trace>
<avrf:trace>trip!std::sys::pal::windows::thread::impl$0::new::thread_start+3d (/rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/std\src\sys\pal\windows\thread.rs @ 55)</avrf:trace>
<avrf:trace>vfbasics!+7ffa194b75ee ( @ 0)</avrf:trace>
<avrf:trace>KERNEL32!BaseThreadInitThunk+1d ( @ 0)</avrf:trace>
<avrf:trace>ntdll!RtlUserThreadStart+28 ( @ 0)</avrf:trace>
</avrf:stackTrace>
</avrf:logEntry>
</avrf:logSession>
</avrf:logfile>
Re-running the above without the Networking layer, the failure is:
All issues appear to related to closing the socket twice.
The original Windows SocketImpl::close method says:
// Interestingly, Socket2 sockets don't seem to call closesocket on drop??#[instrument(skip(self))]fnclose(&mutself) -> IoResult<()>{syscall!(closesocket(self.inner.as_raw_socket()as _), |res| res
== SOCKET_ERROR).map_err(|err| IoError::Other(err,IoOperation::Close)).map(|_| ())}
However, the socket2::Socket whose inner field is a std::net::TcpStream which is a unit struct over net_imp::TcpStream whose inner field is a Socket which is a unit struct over an OwnedSocket which has a Drop impl that calls closesocket:
#[stable(feature = "io_safety", since = "1.63.0")]implDropforOwnedSocket{#[inline]fndrop(&mutself){unsafe{let _ = sys::c::closesocket(self.socketas sys::c::SOCKET);}}}
This leads to a double SocketImpl::close() when the SocketImpl is dropped:
Running
trip.exe
on Windows 11 VM with Application VerifierThe following 3 issues were observed.
Issue 1:
trip 1.1.1.1
This test
icmp
and auto-discovers the src IP address.Fails with
Attempt to use a closed SOCKET
fromtrippy_core::net::platform::windows::routing_interface_query
, which is called at startup to auto-discover the src IP address.Re-running the above without the
Networking
layer, the failure is:Issue 2:
trip 1.1.1.1 -A 10.0.2.15
This test
icmp
and validate the provided src IP address.Fails with
Attempt to use a closed SOCKET
fromtrippy_core::net::source::SourceAddr::validate
which is called at startup to validate the provided IP address.Re-running the above without the
Networking
layer, the failure is:Issue 3:
trip 1.1.1.1 --tcp
Similar issues.
The text was updated successfully, but these errors were encountered: