Bug 5084 - memory leak (on Solaris)
Summary: memory leak (on Solaris)
Status: RESOLVED DUPLICATE of bug 5083
Alias: None
Product: Samba 3.2
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: 3.2.0
Hardware: Sparc Solaris
: P3 normal
Target Milestone: ---
Assignee: Michael Adam
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-15 03:09 UTC by Markus Zell
Modified: 2007-11-15 04:02 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Zell 2007-11-15 03:09:01 UTC
Hello,

while investigating a larger memory problem with samba using libumem on Solaris 10 i got the following output from libumem:

> ::umausers
112000 bytes for 1000 allocations with data size 112:
         libumem.so.1`umem_cache_alloc+0x210
         libumem.so.1`umem_alloc+0x60
         libumem.so.1`malloc+0x28
         libumem.so.1`realloc+0x7c
         Realloc+0x24
         solaris_acl_to_smb_acl+0xac
         solarisacl_sys_acl_get_fd+0x58
         fchmod_acl+0x14
         open_file_ntcreate+0x1304
         reply_ntcreate_and_X+0x1068
         switch_message+0x4c0
         smbd_process+0x7cc
         main+0xa00
         _start+0x5c

It seems, that the function solaris_acl_to_smb_acl is allocating memory which is never released, or do i miss someting?


branches/SAMBA_3_2/source/modules/vfs_solarisacl.c?rev=23784

/*
 * get the access ACL of a file referred to by a fd
 */
SMB_ACL_T solarisacl_sys_acl_get_fd(vfs_handle_struct *handle,
				    files_struct *fsp,
				    int fd)
{
	SMB_ACL_T result = NULL;
	int count;
	SOLARIS_ACL_T solaris_acl = NULL;

	DEBUG(10, ("entering solarisacl_sys_acl_get_fd.\n"));

	if (!solaris_acl_get_fd(fd, &solaris_acl, &count)) {
		goto done;
	}
	/* 
	 * The facl call returns both ACCESS and DEFAULT acls (as present). 
	 * The posix acl_get_fd function returns only the
	 * access acl. So we need to filter this out here.  
	 */
	result = solaris_acl_to_smb_acl(solaris_acl, count,
					SMB_ACL_TYPE_ACCESS);
	if (result == NULL) {
		DEBUG(10, ("conversion solaris_acl -> smb_acl failed (%s).\n",
			   strerror(errno)));
	}
	
 done:
	DEBUG(10, ("solarisacl_sys_acl_get_fd %s.\n", 
		   ((result == NULL) ? "failed" : "succeeded")));
	SAFE_FREE(solaris_acl);

###########
	return NULL;   #### <-- leak
############

}
Comment 1 Michael Adam 2007-11-15 04:02:33 UTC
This is the same as bug 5083.
Or am I missing something subtle here?

*** This bug has been marked as a duplicate of 5083 ***