Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak #183

Closed
pkalever opened this issue Mar 19, 2019 · 3 comments
Closed

Memory Leak #183

pkalever opened this issue Mar 19, 2019 · 3 comments

Comments

@pkalever
Copy link
Contributor

=================================================================
==19195==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 6 byte(s) in 1 object(s) allocated from:
#0 0x7f1ddff9ce60 in strdup (/lib64/libasan.so.5+0x3be60)
#1 0x417c80 in gbStrdup /root/gluster-block/utils/utils.c:462
#2 0x418206 in glusterBlockConfSetOptions /root/gluster-block/utils/dyn-config.c:176
#3 0x41a34d in glusterBlockParseOptions /root/gluster-block/utils/dyn-config.c:448
#4 0x41a803 in glusterBlockLoadConfig /root/gluster-block/utils/dyn-config.c:465
#5 0x402d72 in glusterBlockCLILoadConfig /root/gluster-block/cli/gluster-block.c:78
#6 0x403433 in glusterBlockCliRPC_1 /root/gluster-block/cli/gluster-block.c:163
#7 0x40b920 in glusterBlockCreate /root/gluster-block/cli/gluster-block.c:715
#8 0x40eea7 in glusterBlockParseArgs /root/gluster-block/cli/gluster-block.c:963
#9 0x41073b in main /root/gluster-block/cli/gluster-block.c:1087
#10 0x7f1ddfbbf412 in __libc_start_main (/lib64/libc.so.6+0x24412)

@lxbsz
Copy link
Collaborator

lxbsz commented Apr 3, 2019

=================================================================
==19195==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 6 byte(s) in 1 object(s) allocated from:
#0 0x7f1ddff9ce60 in strdup (/lib64/libasan.so.5+0x3be60)
#1 0x417c80 in gbStrdup /root/gluster-block/utils/utils.c:462

This is okay, no any memory leak here, please see the code:

403 int
404 gbStrdup(char **dest, const char *src,
405          const char *filename, const char *funcname, size_t linenr)
406 {  
407   *dest = NULL;
408    
409   if (!src) {                  
410     return 0;                  
411   }
412    
413   if (!(*dest = strdup(src))) {
414     return -1;                 
415   }
416                                
417   return 0;
418 }

#2 0x418206 in glusterBlockConfSetOptions /root/gluster-block/utils/dyn-config.c:176

Same here, the code is trying to dup memory to the options, which will be hosted and live along with the gluster-bockd daemon.

#3 0x41a34d in glusterBlockParseOptions /root/gluster-block/utils/dyn-config.c:448

Same here.

#4 0x41a803 in glusterBlockLoadConfig /root/gluster-block/utils/dyn-config.c:465

Same here no memory leak.

#5 0x402d72 in glusterBlockCLILoadConfig /root/gluster-block/cli/gluster-block.c:78

I go through the whole code of this didn't find any leak.

#6 0x403433 in glusterBlockCliRPC_1 /root/gluster-block/cli/gluster-block.c:163

same here.

#7 0x40b920 in glusterBlockCreate /root/gluster-block/cli/gluster-block.c:715

same here.

#8 0x40eea7 in glusterBlockParseArgs /root/gluster-block/cli/gluster-block.c:963

same here.

#9 0x41073b in main /root/gluster-block/cli/gluster-block.c:1087

same here.

#10 0x7f1ddfbbf412 in __libc_start_main (/lib64/libc.so.6+0x24412)

@pkalever Did I missed something here ? Couldn't find any memory leak here.

Thanks.

@pkalever
Copy link
Contributor Author

pkalever commented Apr 3, 2019

At the quick glance I cannot find anything too. Lets get back to this later.

@pkalever
Copy link
Contributor Author

Not seen this for a while now, closing it. Feel free to open later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants