pthreads - valgrind complains leak on detached thread -
ubuntu eglibc 2.19-0ubuntu6.6
valgrind-3.11.0
runnable code snippet:
https://godbolt.org/g/9juh05
valgrind complains leak on detached thread.
problem?
a. joinable + pthread_join => ok
b. pthread_detach => valgrind complains leak
==51206== 288 bytes in 1 blocks possibly lost in loss record 1 of 3 ==51206== @ 0x4c2c9b4: calloc (vg_replace_malloc.c:711) ==51206== 0x4012e54: allocate_dtv (dl-tls.c:296) ==51206== 0x4012e54: _dl_allocate_tls (dl-tls.c:460) ==51206== 0x5151da0: allocate_stack (allocatestack.c:589) ==51206== 0x5151da0: pthread_create@@glibc_2.2.5 (pthread_create.c:500) ==51206== 0x400986: start() (pt.cc:29) ==51206== 0x400a02: main (pt.cc:39)
c. pthread_attr_setdetachstate => valgrind complains leak (not in code snippet)
Comments
Post a Comment