Description of problem:
localname is a local struct variable which contains a pointer and an integer (containing the size of whatever is in the block pointed to by the pointer). We end up (through a series of calls) allocating memory for that pointer, but never freeing it before the struct containing the pointer to it just disappears ('cause it's a local function) when the function returns. Here's the valgrind output:
==24113== 37,104 bytes in 4,638 blocks are definitely lost in loss record 76 of 85
==24113== at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==24113== by 0x65F4F7D: UnknownInlinedFun (gssapi_alloc.h:99)
==24113== by 0x65F4F7D: gssalloc_strdup (gssapi_alloc.h:120)
==24113== by 0x65F4F7D: krb5_gss_localname (gssapi_krb5.c:768)
==24113== by 0x65EE4E5: gss_localname (gssd_pname_to_uid.c:173)
==24113== by 0x40D043: gp_export_creds_linux (gp_export.c:757)
==24113== by 0x40D043: gp_export_creds_to_gssx_options (gp_export.c:876)
==24113== by 0x40DEC7: gp_accept_sec_context (gp_rpc_accept_sec_context.c:165)
==24113== by 0x40ADC0: gp_rpc_execute (gp_rpc_process.c:343)
==24113== by 0x40ADC0: gp_rpc_process_call (gp_rpc_process.c:400)
==24113== by 0x4073CB: gp_handle_query (gp_workers.c:447)
==24113== by 0x4073CB: gp_worker_main (gp_workers.c:401)
==24113== by 0x6822DC4: start_thread (pthread_create.c:308)
==24113== by 0x6B2DCEC: clone (clone.S:113)
Version-Release number of selected component (if applicable):
The customer's version is 0.4.1-8.el7_2, but I just downloaded the latest version from brew, and it sure looks like that version has the same bug.
How reproducible:
Customer can easily reproduce it, but it doesn't matter, I found the bug.
Steps to Reproduce:
1.
2.
3.
Actual results:
Memory leaks.
Expected results:
Memory not to leak.
Additional info:
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2017:2033
Description of problem: localname is a local struct variable which contains a pointer and an integer (containing the size of whatever is in the block pointed to by the pointer). We end up (through a series of calls) allocating memory for that pointer, but never freeing it before the struct containing the pointer to it just disappears ('cause it's a local function) when the function returns. Here's the valgrind output: ==24113== 37,104 bytes in 4,638 blocks are definitely lost in loss record 76 of 85 ==24113== at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==24113== by 0x65F4F7D: UnknownInlinedFun (gssapi_alloc.h:99) ==24113== by 0x65F4F7D: gssalloc_strdup (gssapi_alloc.h:120) ==24113== by 0x65F4F7D: krb5_gss_localname (gssapi_krb5.c:768) ==24113== by 0x65EE4E5: gss_localname (gssd_pname_to_uid.c:173) ==24113== by 0x40D043: gp_export_creds_linux (gp_export.c:757) ==24113== by 0x40D043: gp_export_creds_to_gssx_options (gp_export.c:876) ==24113== by 0x40DEC7: gp_accept_sec_context (gp_rpc_accept_sec_context.c:165) ==24113== by 0x40ADC0: gp_rpc_execute (gp_rpc_process.c:343) ==24113== by 0x40ADC0: gp_rpc_process_call (gp_rpc_process.c:400) ==24113== by 0x4073CB: gp_handle_query (gp_workers.c:447) ==24113== by 0x4073CB: gp_worker_main (gp_workers.c:401) ==24113== by 0x6822DC4: start_thread (pthread_create.c:308) ==24113== by 0x6B2DCEC: clone (clone.S:113) Version-Release number of selected component (if applicable): The customer's version is 0.4.1-8.el7_2, but I just downloaded the latest version from brew, and it sure looks like that version has the same bug. How reproducible: Customer can easily reproduce it, but it doesn't matter, I found the bug. Steps to Reproduce: 1. 2. 3. Actual results: Memory leaks. Expected results: Memory not to leak. Additional info: