- labels: --> Provider
When running the CMPIRDaemon, there is a memory leak:
==6585==
==6585== 408 bytes in 3 blocks are possibly lost in
loss record 15 of 19
==6585== at 0x1B909B71: calloc (vg_replace_malloc.c:175)
==6585== by 0x1B8F45B1: _dl_allocate_tls (in
/lib/ld-2.3.5.so)
==6585== by 0x9F7541: pthread_create@@GLIBC_2.1 (in
/lib/libpthread-2.3.5.so)
==6585== by 0x9F79FC: pthread_create@GLIBC_2.0 (in
/lib/libpthread-2.3.5.so)
==6585== by 0x1B910A98: newThread (broker_os.c:88)
==6585== by 0x1B921C5F: __launch_remote_daemon
(tcpcomm_remote.c:1327)
==6585== by 0x9FA92A: pthread_once (in
/lib/libpthread-2.3.5.so)
==6585== by 0x1B921CAF: start_remote_daemon
(tcpcomm_remote.c:1342)
==6585== by 0x8048781: __init_remote_comm_lib
(daemon.c:102)
==6585== by 0x804883B: main (daemon.c:136)
79 static CMPI_THREAD_TYPE newThread
80 (CMPI_THREAD_RETURN (CMPI_THREAD_CDECL
*start )(void *), void
*parm, int detached)
81 {
82 #if defined(CMPI_PLATFORM_LINUX_GENERIC_GNU)
83 pthread_t t;
84 pthread_attr_t tattr;
85 if (detached) {
86 pthread_attr_init(&tattr);
87 pthread_attr_setdetachstate(&tattr,
PTHREAD_CREATE_DETACHED);
--> 88 pthread_create(&t, &tattr, (void
*(*)(void *)) start, parm);
The problem is that the CMPI API does not give a means
of releasing a thread
once it has been created (via 'newThread' function).
This can be easily solved if the broker_os.c newThread
function keeps a list of threads and de-allocates them
once the provider is de-activated (cleaned up).