Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple mio tests leak memory on Windows #1150

Closed
dtacalau opened this issue Nov 14, 2019 · 1 comment
Closed

Multiple mio tests leak memory on Windows #1150

dtacalau opened this issue Nov 14, 2019 · 1 comment
Assignees
Labels
windows Related to the Windows OS.
Milestone

Comments

@dtacalau
Copy link
Contributor

dtacalau commented Nov 14, 2019

The following test suites leak memory when run under drmemory:

  • close_on_drop
  • tcp_stream
  • poll
  • tcp
  • registering
  • tcp_listener
  • udp_socket

To run a test suite under drmemory, for instance for registering.rs:

cargo build
cargo test --test=registering
drmemory.exe target/debug/registering-6c7ff7e724cc4caa.exe

drmemory will report direct and possible leaks:

Application cmdline: "target/debug/registering-6c7ff7e724cc4caa.exe"
Recorded 117 suppression(s) from default C:\Program Files (x86)\Dr. Memory\bin64\suppress-default.txt

Error #18: LEAK 136 direct bytes 0x000000b738fd6220-0x000000b738fd62a8 + 56 indirect bytes
# 0 replace_RtlAllocateHeap                                                  [d:\drmemory_package\common\alloc_replace.c:3771]
# 1 alloc::alloc::alloc                                                      [/rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\src\liballoc\alloc.rs:84]
# 2 alloc::boxed::{{impl}}::call_once<>                                      [/rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\src\liballoc\boxed.rs:787]
# 3 panic_unwind::__rust_maybe_catch_panic                                   [/rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libpanic_unwind\lib.rs:80]
# 4 test::run_test::run_test_inner::{{closure}}                              [/rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libtest\lib.rs:1408]
# 5 std::sys_common::backtrace::__rust_begin_short_backtrace<>               [/rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\src\libstd\sys_common\backtrace.rs:77]
# 6 core::ops::function::FnOnce::call_once<>                                 [/rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\src\libcore\ops\function.rs:235]
# 7 alloc::boxed::{{impl}}::call_once<>                                      [/rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\src\liballoc\boxed.rs:787]
# 8 std::sys::windows::thread::{{impl}}::new::thread_start                   [/rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\/src\libstd\sys\windows\thread.rs:47]
# 9 KERNEL32.dll!BaseThreadInitThunk                                        +0x21     (0x00007ffc1dc513d2 <KERNEL32.dll+0x13d2>)

ERRORS FOUND:
      1 unique,     3 total,    552 byte(s) of leak(s)

These leaks seem to appear in different scenarios than the one reported here #1146:

We need to revisit these after fixing #1146 and/or #1149

@dtacalau dtacalau changed the title registering tests leak memory on Windows Multiple mio tests leak memory on Windows Nov 14, 2019
@Thomasdezeeuw Thomasdezeeuw added the windows Related to the Windows OS. label Nov 16, 2019
@Thomasdezeeuw Thomasdezeeuw added this to the v0.7 milestone Nov 27, 2019
@dtacalau
Copy link
Contributor Author

After merging PR #1154, there are no more leaks. This commits 3d654f7 fixed them all.

Closing as duplicate of #1146 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
windows Related to the Windows OS.
Projects
None yet
Development

No branches or pull requests

2 participants