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

Memory leak on FreeBSD #13420

Closed
alexcrichton opened this issue Apr 9, 2014 · 0 comments · Fixed by #13457
Closed

Memory leak on FreeBSD #13420

alexcrichton opened this issue Apr 9, 2014 · 0 comments · Fixed by #13457
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@alexcrichton
Copy link
Member

==48216== Thread 1:
==48216== 64 bytes in 1 blocks are definitely lost in loss record 5 of 14
==48216==    at 0x11512B3: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==48216==    by 0x1B2DBD3: pthread_attr_init (in /lib/libthr.so.3)
==48216==    by 0x4CE3FB: rt::thread::imp::create::h3b6fad6b5d84e835FQ8::v0.11.pre (in /usr/home/alex/rust/foo)
==48216==    by 0x4D2D98: rt::thread::Thread$LT$$LP$$RP$$GT$::spawn_stack::hfcbbb056292868bcqM8::v0.11.pre (in /usr/home/alex/rust/foo)
==48216==    by 0x4341FA: task::spawn_opts::he0f99b3db2022eba8ed::v0.11.pre (in /usr/home/alex/rust/foo)
==48216==    by 0x4337FC: task::Ops.rt..Runtime::spawn_sibling::h917e725db76901bcvnd::v0.11.pre (in /usr/home/alex/rust/foo)
==48216==    by 0x467D1F: rt::task::Task::spawn_sibling::hc96b4b88f9ed4956tb8::v0.11.pre (in /usr/home/alex/rust/foo)
==48216==    by 0x467A8A: task::TaskBuilder::spawn::h4532d4daa7ebcd1838B::v0.11.pre (in /usr/home/alex/rust/foo)
==48216==    by 0x467F77: task::spawn::hb9f56f98f560a8fa0aC::v0.11.pre (in /usr/home/alex/rust/foo)
==48216==    by 0x4063E7: main::h56af26de3ee65144Oba::v0.0 (in /usr/home/alex/rust/foo)
==48216==    by 0x434CF2: start::closure.7747 (in /usr/home/alex/rust/foo)
==48216==    by 0x4CF582: rt::task::Task::run::closure.41207 (in /usr/home/alex/rust/foo)

I believe that we need to call pthread_attr_destroy

bors added a commit that referenced this issue Apr 11, 2014
On some OSes (such as freebsd), pthread_attr_init allocates memory, so this is
necessary to deallocate that memory.

Closes #13420
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant