1
다음 코드가 있습니다.C 프로그래밍의 pthread 메모리 누수
void *timer1_function(void * eit);
pthread_t timer1;
int thread_check1 = 0;
line72: thread_check1 = pthread_create(&timer1, NULL, timer1_function, NULL);
는 아래 Valgrind의 출력을 도시하고 line 72
에서 문제가 있음을 말한다. 위의 pthread_create
사용에 문제가 있습니까?
272 bytes in 1 blocks are possibly lost in loss record 2 of 5
in main in main.c:72
1: calloc in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
2: _dl_allocate_tls in /build/buildd/eglibc-2.15/elf/dl-tls.c:297
3: [email protected]@GLIBC_2.2.5 in /build/buildd/eglibc-2.15/nptl/allocatestack.c:571
4: main in <a href="file:///home/user/Project-build-desktop-Qt_4_8_1_in_PATH__System__Release/../project/main.c:72" >main.c:72</a>
valgrind는 line72 자체에 문제가 있다고 말하지 않고, 그 행에 할당 된 리소스를 확보하지 못했다고 말합니다. – unkulunkulu