Skip to content

Part 3: Implement Join EDIT and fix memory leak #4

@Horki

Description

@Horki

@rylev Would it be cool to implement join handles, instead of manually waiting for jobs to finish.

  • for example, using destructor (drop)

PS Just an idea

EDIT: example has show memory leak with valgrind

DUMP

==1244233== 
==1244233== HEAP SUMMARY:
==1244233==     in use at exit: 2,368 bytes in 33 blocks
==1244233==   total heap usage: 68 allocs, 35 frees, 6,824 bytes allocated
==1244233== 
==1244233== 32 bytes in 1 blocks are still reachable in loss record 1 of 15
==1244233==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
==1244233==    by 0x12F7A3: alloc (alloc.rs:86)
==1244233==    by 0x12F7A3: alloc_impl (alloc.rs:166)
==1244233==    by 0x12F7A3: allocate (alloc.rs:226)
==1244233==    by 0x12F7A3: exchange_malloc (alloc.rs:316)
==1244233==    by 0x12F7A3: new<std::sync::mpsc::blocking::Inner> (sync.rs:330)
==1244233==    by 0x12F7A3: std::sync::mpsc::blocking::tokens (library/std/src/sync/mpsc/blocking.rs:31)
==1244233==    by 0x115D14: std::sync::mpsc::stream::Packet<T>::recv (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x114D8F: std::sync::mpsc::Receiver<T>::recv (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x117525: _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17hf2a68d5b949536f9E.llvm.9579333282109345907 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x115A09: core::ops::function::FnOnce::call_once{{vtable-shim}} (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x135299: call_once<(),FnOnce<()>,alloc::alloc::Global> (boxed.rs:1328)
==1244233==    by 0x135299: call_once<(),alloc::boxed::Box<FnOnce<()>, alloc::alloc::Global>,alloc::alloc::Global> (boxed.rs:1328)
==1244233==    by 0x135299: std::sys::unix::thread::Thread::new::thread_start (library/std/src/sys/unix/thread.rs:71)
==1244233==    by 0x48A3298: start_thread (in /usr/lib/libpthread-2.33.so)
==1244233==    by 0x49C1052: clone (in /usr/lib/libc-2.33.so)
==1244233== 
==1244233== 40 bytes in 1 blocks are still reachable in loss record 2 of 15
==1244233==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
==1244233==    by 0x130F6C: alloc (alloc.rs:86)
==1244233==    by 0x130F6C: alloc_impl (alloc.rs:166)
==1244233==    by 0x130F6C: allocate (alloc.rs:226)
==1244233==    by 0x130F6C: exchange_malloc (alloc.rs:316)
==1244233==    by 0x130F6C: new<std::sys::unix::mutex::Mutex> (boxed.rs:186)
==1244233==    by 0x130F6C: from<std::sys::unix::mutex::Mutex> (boxed.rs:1015)
==1244233==    by 0x130F6C: std::sys_common::mutex::MovableMutex::new (library/std/src/sys_common/mutex.rs:64)
==1244233==    by 0x1134F8: solution::ThreadPool::new (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x1104DB: solution::main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C42: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C58: _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h0e81cf782c103341E.llvm.6951817481999118218 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x133516: call_once<(),Fn<()>> (function.rs:259)
==1244233==    by 0x133516: do_call<&Fn<()>,i32> (library/std/src/panicking.rs:379)
==1244233==    by 0x133516: try<i32,&Fn<()>> (library/std/src/panicking.rs:343)
==1244233==    by 0x133516: catch_unwind<&Fn<()>,i32> (library/std/src/panic.rs:396)
==1244233==    by 0x133516: std::rt::lang_start_internal (library/std/src/rt.rs:51)
==1244233==    by 0x110901: main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233== 
==1244233== 40 bytes in 1 blocks are still reachable in loss record 3 of 15
==1244233==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
==1244233==    by 0x111094: std::sync::mpsc::spsc_queue::Queue<T,ProducerAddition,ConsumerAddition>::with_additions (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x1119D0: std::sync::mpsc::Sender<T>::send (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110593: solution::main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C42: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C58: _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h0e81cf782c103341E.llvm.6951817481999118218 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x133516: call_once<(),Fn<()>> (function.rs:259)
==1244233==    by 0x133516: do_call<&Fn<()>,i32> (library/std/src/panicking.rs:379)
==1244233==    by 0x133516: try<i32,&Fn<()>> (library/std/src/panicking.rs:343)
==1244233==    by 0x133516: catch_unwind<&Fn<()>,i32> (library/std/src/panic.rs:396)
==1244233==    by 0x133516: std::rt::lang_start_internal (library/std/src/rt.rs:51)
==1244233==    by 0x110901: main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233== 
==1244233== 40 bytes in 1 blocks are still reachable in loss record 4 of 15
==1244233==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
==1244233==    by 0x1110C3: std::sync::mpsc::spsc_queue::Queue<T,ProducerAddition,ConsumerAddition>::with_additions (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x1119D0: std::sync::mpsc::Sender<T>::send (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110593: solution::main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C42: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C58: _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h0e81cf782c103341E.llvm.6951817481999118218 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x133516: call_once<(),Fn<()>> (function.rs:259)
==1244233==    by 0x133516: do_call<&Fn<()>,i32> (library/std/src/panicking.rs:379)
==1244233==    by 0x133516: try<i32,&Fn<()>> (library/std/src/panicking.rs:343)
==1244233==    by 0x133516: catch_unwind<&Fn<()>,i32> (library/std/src/panic.rs:396)
==1244233==    by 0x133516: std::rt::lang_start_internal (library/std/src/rt.rs:51)
==1244233==    by 0x110901: main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233== 
==1244233== 40 bytes in 1 blocks are still reachable in loss record 5 of 15
==1244233==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
==1244233==    by 0x11129D: std::sync::mpsc::spsc_queue::Queue<T,ProducerAddition,ConsumerAddition>::push (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x1114FF: std::sync::mpsc::stream::Packet<T>::send (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x111C1B: std::sync::mpsc::Sender<T>::send (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110593: solution::main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C42: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C58: _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h0e81cf782c103341E.llvm.6951817481999118218 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x133516: call_once<(),Fn<()>> (function.rs:259)
==1244233==    by 0x133516: do_call<&Fn<()>,i32> (library/std/src/panicking.rs:379)
==1244233==    by 0x133516: try<i32,&Fn<()>> (library/std/src/panicking.rs:343)
==1244233==    by 0x133516: catch_unwind<&Fn<()>,i32> (library/std/src/panic.rs:396)
==1244233==    by 0x133516: std::rt::lang_start_internal (library/std/src/rt.rs:51)
==1244233==    by 0x110901: main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233== 
==1244233== 40 bytes in 1 blocks are still reachable in loss record 6 of 15
==1244233==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
==1244233==    by 0x11129D: std::sync::mpsc::spsc_queue::Queue<T,ProducerAddition,ConsumerAddition>::push (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x1114FF: std::sync::mpsc::stream::Packet<T>::send (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x111994: std::sync::mpsc::Sender<T>::send (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x1105DA: solution::main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C42: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C58: _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h0e81cf782c103341E.llvm.6951817481999118218 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x133516: call_once<(),Fn<()>> (function.rs:259)
==1244233==    by 0x133516: do_call<&Fn<()>,i32> (library/std/src/panicking.rs:379)
==1244233==    by 0x133516: try<i32,&Fn<()>> (library/std/src/panicking.rs:343)
==1244233==    by 0x133516: catch_unwind<&Fn<()>,i32> (library/std/src/panic.rs:396)
==1244233==    by 0x133516: std::rt::lang_start_internal (library/std/src/rt.rs:51)
==1244233==    by 0x110901: main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233== 
==1244233== 40 bytes in 1 blocks are still reachable in loss record 7 of 15
==1244233==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
==1244233==    by 0x11129D: std::sync::mpsc::spsc_queue::Queue<T,ProducerAddition,ConsumerAddition>::push (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x1114FF: std::sync::mpsc::stream::Packet<T>::send (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x111994: std::sync::mpsc::Sender<T>::send (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110621: solution::main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C42: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C58: _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h0e81cf782c103341E.llvm.6951817481999118218 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x133516: call_once<(),Fn<()>> (function.rs:259)
==1244233==    by 0x133516: do_call<&Fn<()>,i32> (library/std/src/panicking.rs:379)
==1244233==    by 0x133516: try<i32,&Fn<()>> (library/std/src/panicking.rs:343)
==1244233==    by 0x133516: catch_unwind<&Fn<()>,i32> (library/std/src/panic.rs:396)
==1244233==    by 0x133516: std::rt::lang_start_internal (library/std/src/rt.rs:51)
==1244233==    by 0x110901: main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233== 
==1244233== 48 bytes in 1 blocks are still reachable in loss record 8 of 15
==1244233==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
==1244233==    by 0x113524: solution::ThreadPool::new (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x1104DB: solution::main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C42: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C58: _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h0e81cf782c103341E.llvm.6951817481999118218 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x133516: call_once<(),Fn<()>> (function.rs:259)
==1244233==    by 0x133516: do_call<&Fn<()>,i32> (library/std/src/panicking.rs:379)
==1244233==    by 0x133516: try<i32,&Fn<()>> (library/std/src/panicking.rs:343)
==1244233==    by 0x133516: catch_unwind<&Fn<()>,i32> (library/std/src/panic.rs:396)
==1244233==    by 0x133516: std::rt::lang_start_internal (library/std/src/rt.rs:51)
==1244233==    by 0x110901: main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233== 
==1244233== 64 bytes in 4 blocks are still reachable in loss record 9 of 15
==1244233==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
==1244233==    by 0x134EAB: alloc (alloc.rs:86)
==1244233==    by 0x134EAB: alloc_impl (alloc.rs:166)
==1244233==    by 0x134EAB: allocate (alloc.rs:226)
==1244233==    by 0x134EAB: exchange_malloc (alloc.rs:316)
==1244233==    by 0x134EAB: std::sys::unix::thread::Thread::new (library/std/src/sys/unix/thread.rs:28)
==1244233==    by 0x11583A: std::thread::spawn (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x11360D: solution::ThreadPool::new (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x1104DB: solution::main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C42: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C58: _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h0e81cf782c103341E.llvm.6951817481999118218 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x133516: call_once<(),Fn<()>> (function.rs:259)
==1244233==    by 0x133516: do_call<&Fn<()>,i32> (library/std/src/panicking.rs:379)
==1244233==    by 0x133516: try<i32,&Fn<()>> (library/std/src/panicking.rs:343)
==1244233==    by 0x133516: catch_unwind<&Fn<()>,i32> (library/std/src/panic.rs:396)
==1244233==    by 0x133516: std::rt::lang_start_internal (library/std/src/rt.rs:51)
==1244233==    by 0x110901: main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233== 
==1244233== 128 bytes in 4 blocks are still reachable in loss record 10 of 15
==1244233==    at 0x4840B65: calloc (vg_replace_malloc.c:760)
==1244233==    by 0x4901E72: __cxa_thread_atexit_impl (in /usr/lib/libc-2.33.so)
==1244233==    by 0x12B1E7: try_register_dtor<core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>> (library/std/src/thread/local.rs:490)
==1244233==    by 0x12B1E7: std::thread::local::fast::Key<T>::try_initialize (library/std/src/thread/local.rs:471)
==1244233==    by 0x131889: get<core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>,fn() -> core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>> (library/std/src/thread/local.rs:456)
==1244233==    by 0x131889: __getit (library/std/src/thread/local.rs:183)
==1244233==    by 0x131889: try_with<core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>,closure-0,()> (library/std/src/thread/local.rs:271)
==1244233==    by 0x131889: with<core::cell::RefCell<core::option::Option<std::sys_common::thread_info::ThreadInfo>>,closure-0,()> (library/std/src/thread/local.rs:248)
==1244233==    by 0x131889: std::sys_common::thread_info::set (library/std/src/sys_common/thread_info.rs:40)
==1244233==    by 0x1159FC: core::ops::function::FnOnce::call_once{{vtable-shim}} (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x135299: call_once<(),FnOnce<()>,alloc::alloc::Global> (boxed.rs:1328)
==1244233==    by 0x135299: call_once<(),alloc::boxed::Box<FnOnce<()>, alloc::alloc::Global>,alloc::alloc::Global> (boxed.rs:1328)
==1244233==    by 0x135299: std::sys::unix::thread::Thread::new::thread_start (library/std/src/sys/unix/thread.rs:71)
==1244233==    by 0x48A3298: start_thread (in /usr/lib/libpthread-2.33.so)
==1244233==    by 0x49C1052: clone (in /usr/lib/libc-2.33.so)
==1244233== 
==1244233== 160 bytes in 4 blocks are still reachable in loss record 11 of 15
==1244233==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
==1244233==    by 0x11575D: std::thread::spawn (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x11360D: solution::ThreadPool::new (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x1104DB: solution::main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C42: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C58: _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h0e81cf782c103341E.llvm.6951817481999118218 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x133516: call_once<(),Fn<()>> (function.rs:259)
==1244233==    by 0x133516: do_call<&Fn<()>,i32> (library/std/src/panicking.rs:379)
==1244233==    by 0x133516: try<i32,&Fn<()>> (library/std/src/panicking.rs:343)
==1244233==    by 0x133516: catch_unwind<&Fn<()>,i32> (library/std/src/panic.rs:396)
==1244233==    by 0x133516: std::rt::lang_start_internal (library/std/src/rt.rs:51)
==1244233==    by 0x110901: main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233== 
==1244233== 160 bytes in 4 blocks are still reachable in loss record 12 of 15
==1244233==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
==1244233==    by 0x115806: std::thread::spawn (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x11360D: solution::ThreadPool::new (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x1104DB: solution::main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C42: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C58: _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h0e81cf782c103341E.llvm.6951817481999118218 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x133516: call_once<(),Fn<()>> (function.rs:259)
==1244233==    by 0x133516: do_call<&Fn<()>,i32> (library/std/src/panicking.rs:379)
==1244233==    by 0x133516: try<i32,&Fn<()>> (library/std/src/panicking.rs:343)
==1244233==    by 0x133516: catch_unwind<&Fn<()>,i32> (library/std/src/panic.rs:396)
==1244233==    by 0x133516: std::rt::lang_start_internal (library/std/src/rt.rs:51)
==1244233==    by 0x110901: main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233== 
==1244233== 192 bytes in 1 blocks are still reachable in loss record 13 of 15
==1244233==    at 0x4840EB8: memalign (vg_replace_malloc.c:906)
==1244233==    by 0x4840FEE: posix_memalign (vg_replace_malloc.c:1070)
==1244233==    by 0x131FE9: aligned_malloc (library/std/src/sys/unix/alloc.rs:95)
==1244233==    by 0x131FE9: alloc (library/std/src/sys/unix/alloc.rs:22)
==1244233==    by 0x131FE9: __rdl_alloc (library/std/src/alloc.rs:356)
==1244233==    by 0x111A54: std::sync::mpsc::Sender<T>::send (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110593: solution::main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C42: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C58: _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h0e81cf782c103341E.llvm.6951817481999118218 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x133516: call_once<(),Fn<()>> (function.rs:259)
==1244233==    by 0x133516: do_call<&Fn<()>,i32> (library/std/src/panicking.rs:379)
==1244233==    by 0x133516: try<i32,&Fn<()>> (library/std/src/panicking.rs:343)
==1244233==    by 0x133516: catch_unwind<&Fn<()>,i32> (library/std/src/panic.rs:396)
==1244233==    by 0x133516: std::rt::lang_start_internal (library/std/src/rt.rs:51)
==1244233==    by 0x110901: main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233== 
==1244233== 192 bytes in 4 blocks are still reachable in loss record 14 of 15
==1244233==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
==1244233==    by 0x12B562: alloc (alloc.rs:86)
==1244233==    by 0x12B562: alloc_impl (alloc.rs:166)
==1244233==    by 0x12B562: allocate (alloc.rs:226)
==1244233==    by 0x12B562: exchange_malloc (alloc.rs:316)
==1244233==    by 0x12B562: new<std::thread::Inner> (sync.rs:330)
==1244233==    by 0x12B562: std::thread::Thread::new (library/std/src/thread/mod.rs:1061)
==1244233==    by 0x115739: std::thread::spawn (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x11360D: solution::ThreadPool::new (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x1104DB: solution::main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C42: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C58: _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h0e81cf782c103341E.llvm.6951817481999118218 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x133516: call_once<(),Fn<()>> (function.rs:259)
==1244233==    by 0x133516: do_call<&Fn<()>,i32> (library/std/src/panicking.rs:379)
==1244233==    by 0x133516: try<i32,&Fn<()>> (library/std/src/panicking.rs:343)
==1244233==    by 0x133516: catch_unwind<&Fn<()>,i32> (library/std/src/panic.rs:396)
==1244233==    by 0x133516: std::rt::lang_start_internal (library/std/src/rt.rs:51)
==1244233==    by 0x110901: main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233== 
==1244233== 1,152 bytes in 4 blocks are possibly lost in loss record 15 of 15
==1244233==    at 0x4840B65: calloc (vg_replace_malloc.c:760)
==1244233==    by 0x4012E8B: _dl_allocate_tls (in /usr/lib/ld-2.33.so)
==1244233==    by 0x48A4016: pthread_create@@GLIBC_2.2.5 (in /usr/lib/libpthread-2.33.so)
==1244233==    by 0x134FB1: std::sys::unix::thread::Thread::new (library/std/src/sys/unix/thread.rs:50)
==1244233==    by 0x11583A: std::thread::spawn (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x11360D: solution::ThreadPool::new (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x1104DB: solution::main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C42: std::sys_common::backtrace::__rust_begin_short_backtrace (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x110C58: _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h0e81cf782c103341E.llvm.6951817481999118218 (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233==    by 0x133516: call_once<(),Fn<()>> (function.rs:259)
==1244233==    by 0x133516: do_call<&Fn<()>,i32> (library/std/src/panicking.rs:379)
==1244233==    by 0x133516: try<i32,&Fn<()>> (library/std/src/panicking.rs:343)
==1244233==    by 0x133516: catch_unwind<&Fn<()>,i32> (library/std/src/panic.rs:396)
==1244233==    by 0x133516: std::rt::lang_start_internal (library/std/src/rt.rs:51)
==1244233==    by 0x110901: main (in /home/horky/Documents/WorkspaceRust/ryanlevick/rust-workshop/part-3/solution/target/release/solution)
==1244233== 
==1244233== LEAK SUMMARY:
==1244233==    definitely lost: 0 bytes in 0 blocks
==1244233==    indirectly lost: 0 bytes in 0 blocks
==1244233==      possibly lost: 1,152 bytes in 4 blocks
==1244233==    still reachable: 1,216 bytes in 29 blocks
==1244233==         suppressed: 0 bytes in 0 blocks
==1244233== 
==1244233== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions