Skip to content

Instantly share code, notes, and snippets.

@koivunej
Created January 5, 2021 09:50
Show Gist options
  • Save koivunej/256347b51262ce9ff51ee1f63ff3cbd7 to your computer and use it in GitHub Desktop.
Save koivunej/256347b51262ce9ff51ee1f63ff3cbd7 to your computer and use it in GitHub Desktop.
tokio issue 2535 valgrind --leak-check=full --show-leak-kinds=all --num-callers=500 without enabling io
==108942== Memcheck, a memory error detector
==108942== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==108942== Using Valgrind-3.17.0.GIT and LibVEX; rerun with -h for copyright info
==108942== Command: target/debug/tokio-issue-2535
==108942==
I'm alive!
==108942==
==108942== HEAP SUMMARY:
==108942== in use at exit: 1,056 bytes in 2 blocks
==108942== total heap usage: 58 allocs, 56 frees, 16,829 bytes allocated
==108942==
==108942== 32 bytes in 1 blocks are still reachable in loss record 1 of 2
==108942== at 0x484D93F: malloc (vg_replace_malloc.c:307)
==108942== by 0x27FBEB: alloc::alloc::alloc (alloc.rs:84)
==108942== by 0x27FCA9: alloc::alloc::Global::alloc_impl (alloc.rs:164)
==108942== by 0x280819: <alloc::alloc::Global as core::alloc::AllocRef>::alloc (alloc.rs:224)
==108942== by 0x27FB4C: alloc::alloc::exchange_malloc (alloc.rs:314)
==108942== by 0x27BBA9: new<parking_lot_core::parking_lot::HashTable> (boxed.rs:178)
==108942== by 0x27BBA9: parking_lot_core::parking_lot::HashTable::new (parking_lot.rs:57)
==108942== by 0x27C031: parking_lot_core::parking_lot::create_hashtable (parking_lot.rs:213)
==108942== by 0x27C002: parking_lot_core::parking_lot::get_hashtable (parking_lot.rs:201)
==108942== by 0x27C103: parking_lot_core::parking_lot::grow_hashtable (parking_lot.rs:243)
==108942== by 0x27BEB1: parking_lot_core::parking_lot::ThreadData::new (parking_lot.rs:156)
==108942== by 0x27C95D: parking_lot_core::parking_lot::with_thread_data::THREAD_DATA::__init (parking_lot.rs:178)
==108942== by 0x285E0F: core::ops::function::FnOnce::call_once (function.rs:227)
==108942== by 0x284DD9: std::thread::local::lazy::LazyKeyInner<T>::initialize (local.rs:304)
==108942== by 0x27F315: std::thread::local::fast::Key<T>::try_initialize (local.rs:473)
==108942== by 0x27F45A: std::thread::local::fast::Key<T>::get (local.rs:456)
==108942== by 0x27C98C: parking_lot_core::parking_lot::with_thread_data::THREAD_DATA::__getit (local.rs:183)
==108942== by 0x27798A: std::thread::local::LocalKey<T>::try_with (local.rs:271)
==108942== by 0x276023: with_thread_data<parking_lot_core::parking_lot::ParkResult,closure-0> (parking_lot.rs:179)
==108942== by 0x276023: parking_lot_core::parking_lot::park (parking_lot.rs:576)
==108942== by 0x27A552: parking_lot::condvar::Condvar::wait_until_internal (condvar.rs:338)
==108942== by 0x1D0095: parking_lot::condvar::Condvar::wait_for (condvar.rs:397)
==108942== by 0x1DBFB9: tokio::loom::std::parking_lot::Condvar::wait_timeout (parking_lot.rs:100)
==108942== by 0x214CF8: tokio::park::thread::Inner::park_timeout (thread.rs:160)
==108942== by 0x214406: <tokio::park::thread::ParkThread as tokio::park::Park>::park_timeout (thread.rs:67)
==108942== by 0x1D1B9E: <tokio::park::either::Either<A,B> as tokio::park::Park>::park_timeout (either.rs:38)
==108942== by 0x20089D: tokio::time::driver::Driver<P>::park_internal (mod.rs:219)
==108942== by 0x2015CF: <tokio::time::driver::Driver<P> as tokio::park::Park>::park (mod.rs:391)
==108942== by 0x1D19FA: <tokio::park::either::Either<A,B> as tokio::park::Park>::park (either.rs:30)
==108942== by 0x1F1FB6: <tokio::runtime::driver::Driver as tokio::park::Park>::park (driver.rs:196)
==108942== by 0x1E9EE8: tokio::runtime::park::Inner::park_driver (park.rs:205)
==108942== by 0x1E974F: tokio::runtime::park::Inner::park (park.rs:137)
==108942== by 0x1E920B: <tokio::runtime::park::Parker as tokio::park::Park>::park (park.rs:93)
==108942== by 0x237137: tokio::runtime::thread_pool::worker::Context::park_timeout (worker.rs:422)
==108942== by 0x236EA5: tokio::runtime::thread_pool::worker::Context::park (worker.rs:398)
==108942== by 0x236241: tokio::runtime::thread_pool::worker::Context::run (worker.rs:328)
==108942== by 0x235F32: tokio::runtime::thread_pool::worker::run::{{closure}} (worker.rs:303)
==108942== by 0x207179: tokio::macros::scoped_tls::ScopedKey<T>::set (scoped_tls.rs:61)
==108942== by 0x235E22: tokio::runtime::thread_pool::worker::run (worker.rs:300)
==108942== by 0x235CCA: tokio::runtime::thread_pool::worker::Launch::launch::{{closure}} (worker.rs:279)
==108942== by 0x1C57FF: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll (task.rs:42)
==108942== by 0x1D2B58: tokio::runtime::task::core::Core<T,S>::poll::{{closure}} (core.rs:173)
==108942== by 0x1E5BFA: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut (unsafe_cell.rs:14)
==108942== by 0x1D299D: tokio::runtime::task::core::Core<T,S>::poll (core.rs:158)
==108942== by 0x20B4E3: tokio::runtime::task::harness::Harness<T,S>::poll::{{closure}} (harness.rs:107)
==108942== by 0x20D3AF: core::ops::function::FnOnce::call_once (function.rs:227)
==108942== by 0x1A9BDA: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once (panic.rs:322)
==108942== by 0x21C43E: std::panicking::try::do_call (panicking.rs:381)
==108942== by 0x22612C: __rust_try (in .../issue-repros/tokio-issue-2535/target/debug/tokio-issue-2535)
==108942== by 0x21C041: std::panicking::try (panicking.rs:345)
==108942== by 0x1AA0CA: std::panic::catch_unwind (panic.rs:396)
==108942== by 0x20B08F: tokio::runtime::task::harness::Harness<T,S>::poll (harness.rs:89)
==108942== by 0x234E51: tokio::runtime::task::raw::poll (raw.rs:104)
==108942== by 0x234D5E: tokio::runtime::task::raw::RawTask::poll (raw.rs:66)
==108942== by 0x2083D0: tokio::runtime::task::Notified<S>::run (mod.rs:171)
==108942== by 0x22C65E: tokio::runtime::blocking::pool::Inner::run (pool.rs:277)
==108942== by 0x22C3ED: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}} (pool.rs:257)
==108942== by 0x1BD462: std::sys_common::backtrace::__rust_begin_short_backtrace (backtrace.rs:125)
==108942== by 0x1EDE62: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}} (mod.rs:474)
==108942== by 0x1A9BB2: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once (panic.rs:322)
==108942== by 0x21C391: std::panicking::try::do_call (panicking.rs:381)
==108942== by 0x22612C: __rust_try (in .../issue-repros/tokio-issue-2535/target/debug/tokio-issue-2535)
==108942== by 0x21C2B3: std::panicking::try (panicking.rs:345)
==108942== by 0x1AA062: std::panic::catch_unwind (panic.rs:396)
==108942== by 0x1EDC23: std::thread::Builder::spawn_unchecked::{{closure}} (mod.rs:473)
==108942== by 0x20D2FE: core::ops::function::FnOnce::call_once{{vtable-shim}} (function.rs:227)
==108942== by 0x29FA29: call_once<(),FnOnce<()>,alloc::alloc::Global> (boxed.rs:1307)
==108942== by 0x29FA29: call_once<(),alloc::boxed::Box<FnOnce<()>, alloc::alloc::Global>,alloc::alloc::Global> (boxed.rs:1307)
==108942== by 0x29FA29: std::sys::unix::thread::Thread::new::thread_start (thread.rs:71)
==108942== by 0x48B8608: start_thread (pthread_create.c:477)
==108942== by 0x4B49292: clone (clone.S:95)
==108942==
==108942== 1,024 bytes in 1 blocks are still reachable in loss record 2 of 2
==108942== at 0x48507BE: memalign (vg_replace_malloc.c:906)
==108942== by 0x48508E2: posix_memalign (vg_replace_malloc.c:1070)
==108942== by 0x29C919: aligned_malloc (alloc.rs:95)
==108942== by 0x29C919: alloc (alloc.rs:22)
==108942== by 0x29C919: __rdl_alloc (alloc.rs:356)
==108942== by 0x27FBEB: alloc::alloc::alloc (alloc.rs:84)
==108942== by 0x27FCA9: alloc::alloc::Global::alloc_impl (alloc.rs:164)
==108942== by 0x280819: <alloc::alloc::Global as core::alloc::AllocRef>::alloc (alloc.rs:224)
==108942== by 0x28188E: alloc::raw_vec::RawVec<T,A>::allocate_in (raw_vec.rs:189)
==108942== by 0x28205C: alloc::raw_vec::RawVec<T,A>::with_capacity_in (raw_vec.rs:130)
==108942== by 0x28169E: alloc::raw_vec::RawVec<T>::with_capacity (raw_vec.rs:93)
==108942== by 0x2867DE: alloc::vec::Vec<T>::with_capacity (vec.rs:363)
==108942== by 0x27BA02: parking_lot_core::parking_lot::HashTable::new (parking_lot.rs:51)
==108942== by 0x27C031: parking_lot_core::parking_lot::create_hashtable (parking_lot.rs:213)
==108942== by 0x27C002: parking_lot_core::parking_lot::get_hashtable (parking_lot.rs:201)
==108942== by 0x27C103: parking_lot_core::parking_lot::grow_hashtable (parking_lot.rs:243)
==108942== by 0x27BEB1: parking_lot_core::parking_lot::ThreadData::new (parking_lot.rs:156)
==108942== by 0x27C95D: parking_lot_core::parking_lot::with_thread_data::THREAD_DATA::__init (parking_lot.rs:178)
==108942== by 0x285E0F: core::ops::function::FnOnce::call_once (function.rs:227)
==108942== by 0x284DD9: std::thread::local::lazy::LazyKeyInner<T>::initialize (local.rs:304)
==108942== by 0x27F315: std::thread::local::fast::Key<T>::try_initialize (local.rs:473)
==108942== by 0x27F45A: std::thread::local::fast::Key<T>::get (local.rs:456)
==108942== by 0x27C98C: parking_lot_core::parking_lot::with_thread_data::THREAD_DATA::__getit (local.rs:183)
==108942== by 0x27798A: std::thread::local::LocalKey<T>::try_with (local.rs:271)
==108942== by 0x276023: with_thread_data<parking_lot_core::parking_lot::ParkResult,closure-0> (parking_lot.rs:179)
==108942== by 0x276023: parking_lot_core::parking_lot::park (parking_lot.rs:576)
==108942== by 0x27A552: parking_lot::condvar::Condvar::wait_until_internal (condvar.rs:338)
==108942== by 0x1D0095: parking_lot::condvar::Condvar::wait_for (condvar.rs:397)
==108942== by 0x1DBFB9: tokio::loom::std::parking_lot::Condvar::wait_timeout (parking_lot.rs:100)
==108942== by 0x214CF8: tokio::park::thread::Inner::park_timeout (thread.rs:160)
==108942== by 0x214406: <tokio::park::thread::ParkThread as tokio::park::Park>::park_timeout (thread.rs:67)
==108942== by 0x1D1B9E: <tokio::park::either::Either<A,B> as tokio::park::Park>::park_timeout (either.rs:38)
==108942== by 0x20089D: tokio::time::driver::Driver<P>::park_internal (mod.rs:219)
==108942== by 0x2015CF: <tokio::time::driver::Driver<P> as tokio::park::Park>::park (mod.rs:391)
==108942== by 0x1D19FA: <tokio::park::either::Either<A,B> as tokio::park::Park>::park (either.rs:30)
==108942== by 0x1F1FB6: <tokio::runtime::driver::Driver as tokio::park::Park>::park (driver.rs:196)
==108942== by 0x1E9EE8: tokio::runtime::park::Inner::park_driver (park.rs:205)
==108942== by 0x1E974F: tokio::runtime::park::Inner::park (park.rs:137)
==108942== by 0x1E920B: <tokio::runtime::park::Parker as tokio::park::Park>::park (park.rs:93)
==108942== by 0x237137: tokio::runtime::thread_pool::worker::Context::park_timeout (worker.rs:422)
==108942== by 0x236EA5: tokio::runtime::thread_pool::worker::Context::park (worker.rs:398)
==108942== by 0x236241: tokio::runtime::thread_pool::worker::Context::run (worker.rs:328)
==108942== by 0x235F32: tokio::runtime::thread_pool::worker::run::{{closure}} (worker.rs:303)
==108942== by 0x207179: tokio::macros::scoped_tls::ScopedKey<T>::set (scoped_tls.rs:61)
==108942== by 0x235E22: tokio::runtime::thread_pool::worker::run (worker.rs:300)
==108942== by 0x235CCA: tokio::runtime::thread_pool::worker::Launch::launch::{{closure}} (worker.rs:279)
==108942== by 0x1C57FF: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll (task.rs:42)
==108942== by 0x1D2B58: tokio::runtime::task::core::Core<T,S>::poll::{{closure}} (core.rs:173)
==108942== by 0x1E5BFA: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut (unsafe_cell.rs:14)
==108942== by 0x1D299D: tokio::runtime::task::core::Core<T,S>::poll (core.rs:158)
==108942== by 0x20B4E3: tokio::runtime::task::harness::Harness<T,S>::poll::{{closure}} (harness.rs:107)
==108942== by 0x20D3AF: core::ops::function::FnOnce::call_once (function.rs:227)
==108942== by 0x1A9BDA: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once (panic.rs:322)
==108942== by 0x21C43E: std::panicking::try::do_call (panicking.rs:381)
==108942== by 0x22612C: __rust_try (in .../issue-repros/tokio-issue-2535/target/debug/tokio-issue-2535)
==108942== by 0x21C041: std::panicking::try (panicking.rs:345)
==108942== by 0x1AA0CA: std::panic::catch_unwind (panic.rs:396)
==108942== by 0x20B08F: tokio::runtime::task::harness::Harness<T,S>::poll (harness.rs:89)
==108942== by 0x234E51: tokio::runtime::task::raw::poll (raw.rs:104)
==108942== by 0x234D5E: tokio::runtime::task::raw::RawTask::poll (raw.rs:66)
==108942== by 0x2083D0: tokio::runtime::task::Notified<S>::run (mod.rs:171)
==108942== by 0x22C65E: tokio::runtime::blocking::pool::Inner::run (pool.rs:277)
==108942== by 0x22C3ED: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}} (pool.rs:257)
==108942== by 0x1BD462: std::sys_common::backtrace::__rust_begin_short_backtrace (backtrace.rs:125)
==108942== by 0x1EDE62: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}} (mod.rs:474)
==108942== by 0x1A9BB2: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once (panic.rs:322)
==108942== by 0x21C391: std::panicking::try::do_call (panicking.rs:381)
==108942== by 0x22612C: __rust_try (in .../issue-repros/tokio-issue-2535/target/debug/tokio-issue-2535)
==108942== by 0x21C2B3: std::panicking::try (panicking.rs:345)
==108942== by 0x1AA062: std::panic::catch_unwind (panic.rs:396)
==108942== by 0x1EDC23: std::thread::Builder::spawn_unchecked::{{closure}} (mod.rs:473)
==108942== by 0x20D2FE: core::ops::function::FnOnce::call_once{{vtable-shim}} (function.rs:227)
==108942== by 0x29FA29: call_once<(),FnOnce<()>,alloc::alloc::Global> (boxed.rs:1307)
==108942== by 0x29FA29: call_once<(),alloc::boxed::Box<FnOnce<()>, alloc::alloc::Global>,alloc::alloc::Global> (boxed.rs:1307)
==108942== by 0x29FA29: std::sys::unix::thread::Thread::new::thread_start (thread.rs:71)
==108942== by 0x48B8608: start_thread (pthread_create.c:477)
==108942== by 0x4B49292: clone (clone.S:95)
==108942==
==108942== LEAK SUMMARY:
==108942== definitely lost: 0 bytes in 0 blocks
==108942== indirectly lost: 0 bytes in 0 blocks
==108942== possibly lost: 0 bytes in 0 blocks
==108942== still reachable: 1,056 bytes in 2 blocks
==108942== suppressed: 0 bytes in 0 blocks
==108942==
==108942== For lists of detected and suppressed errors, rerun with: -s
==108942== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment