Bug 5541 - Memory leak found on SUNRPC code on multi-threaded servers
Summary: Memory leak found on SUNRPC code on multi-threaded servers
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.3.6
: P3 critical
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-04 12:53 UTC by André Cruz
Modified: 2014-07-03 11:43 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security?


Attachments
Patch to correct bug. (217 bytes, patch)
2008-01-04 12:57 UTC, André Cruz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description André Cruz 2008-01-04 12:53:59 UTC
Not all structures are being freed on __rpc_thread_destroy() . This causes
memory usage to grow ad infinitum when the server is multithreaded.

Apply the following patch to fix:

--- glibc-2.3.6/sunrpc/rpc_thread.c	2003-02-22 01:57:51.000000000 +0000
+++ build-tree/glibc-2.3.6/sunrpc/rpc_thread.c	2008-01-04 12:52:06.000000000 +0000
@@ -29,6 +29,8 @@
 		free (tvp->svcraw_private_s);
 		free (tvp->authdes_cache_s);
 		free (tvp->authdes_lru_s);
+		free (tvp->svc_xports_s);
+		free (tvp->svc_pollfd_s);
 		free (tvp);
 		__libc_tsd_set (RPC_VARS, NULL);
 	}
Comment 1 André Cruz 2008-01-04 12:57:07 UTC
Created attachment 2169 [details]
Patch to correct bug.

Looks like it works.
Comment 2 Ulrich Drepper 2008-01-09 21:52:49 UTC
Applied to mainline.