This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: free thread related memory created by pthread_create()
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Joël Krähemann <jkraehemann at gmail dot com>
- Cc: libc-help at sourceware dot org, jkraehemann-guest at users dot alioth dot debian dot org
- Date: Sun, 26 Jun 2016 22:40:46 +0200
- Subject: Re: free thread related memory created by pthread_create()
- Authentication-results: sourceware.org; auth=none
- References: <CA+Owze482Jp6rf6O0PH=YM7f2HiKcbSJRjOnYbOdOZnp32zKhw at mail dot gmail dot com>
* Joël Krähemann:
> The very last entry of following shows the issue with pthread_create():
>
> http://pastebin.com/aQfAQV2q
Usually, this is due to a race condition at process termination.
valgrind may or may not report the resources of a thread still running
at process termination as leaked.
You can avoid the valgrind warning by delaying exit until all other
threads have terminated.
It is not a memory leak in the classic because this happen only during
process termination, just before the kernel is about to free all
process memory anyway.