librdkafka icon indicating copy to clipboard operation
librdkafka copied to clipboard

Memory Leak Issue Found When Using rdkafka Library

Open Huu-Yuu opened this issue 7 months ago • 1 comments

Hello! During the process of using the rdkafka library, I detected a memory leak issue through the Valgrind tool. Here are the detailed information:

==2495== 16 bytes in 1 blocks are definitely lost in loss record 156 of 4,673
==2495==    at 0x4C28C20: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2495==    by 0x7D76C77: glob (in /users/csgdri/csgems/source/lib/linux64/libc.so.6)
==2495==    by 0x194FF5F7: ??? (in /users/csgdri/csgems/lib/libgssapi_krb5.so.2)
==2495==    by 0x194FFBAA: gss_indicate_mechs (in /users/csgdri/csgems/lib/libgssapi_krb5.so.2)
==2495==    by 0x19501935: gss_indicate_mechs_by_attrs (in /users/csgdri/csgems/lib/libgssapi_krb5.so.2)
==2495==    by 0x1A24EC95: ??? (in /usr/lib/x86_64-linux-gnu/sasl2/libgs2.so.2.0.25)
==2495==    by 0x1A24FF8E: gs2_client_plug_init (in /usr/lib/x86_64-linux-gnu/sasl2/libgs2.so.2.0.25)
==2495==    by 0x8CA6ED9: sasl_client_add_plugin (in /users/csgdri/csgems/source/lib/linux64/libsasl2.so.2)
==2495==    by 0x8CB2DFF: ??? (in /users/csgdri/csgems/source/lib/linux64/libsasl2.so.2)
==2495==    by 0x8CA77B0: sasl_client_init (in /users/csgdri/csgems/source/lib/linux64/libsasl2.so.2)
==2495==    by 0x654E328: rd_kafka_sasl_cyrus_global_init (rdkafka_sasl_cyrus.c:703)
==2495==    by 0x63B1B2E: rd_kafka_global_cnt_incr (rdkafka.c:210)
==2495==    by 0x63B1B2E: rd_kafka_new (rdkafka.c:2244)

From the above information, it seems that the memory leak occurred during the call of the rd_kafka_new function, and through a series of function calls, it eventually led to the definite loss of 16 bytes of memory. My environment information is as follows:

  • Operating System: [ubuntu]
  • rdkafka Library Version: [release]

I hope you can pay attention to and solve this problem. Thank you very much!

Huu-Yuu avatar Mar 17 '25 09:03 Huu-Yuu