From 679cab88fe71ce59c158f2a6ba99b669a9069f63 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 9 Dec 2009 18:50:49 +0000 Subject: Fix a memory leak in hotplug2 environment handling. Bump hotplug2 to the latest svn revision, remove obsolete patches. Memory leak is caused by the way hotplug2 handles environment variables, using setenv() and unsetenv(). setenv() creates copies of the supplied strings, but, due to a POSIX blunder, these copies are never destroyed by unsetenv(), neither in glibc nor uclibc - not until the program terminates. Since some events are handled directly in the main process, even when configured with the "fork" worker, hotplug2 memory usage will keep growing over time. This can be observed by running "udevtrigger" and noting the increase in hotplug2 VmRSS after each run. This patch uses putenv() instead, which leaves storage management to the caller, so that we can explicitly delete stuff when it's no longer needed. Signed-off-by: Aleksandar Radovanovic SVN-Revision: 18725 --- package/hotplug2/patches/100-recv_check.patch | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 package/hotplug2/patches/100-recv_check.patch (limited to 'package/hotplug2/patches/100-recv_check.patch') diff --git a/package/hotplug2/patches/100-recv_check.patch b/package/hotplug2/patches/100-recv_check.patch deleted file mode 100644 index 168df47bb0..0000000000 --- a/package/hotplug2/patches/100-recv_check.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/hotplug2.c -+++ b/hotplug2.c -@@ -300,6 +300,9 @@ int main(int argc, char *argv[]) { - worker_ctx = settings->worker->module->init(settings); - while (process) { - size = recv(settings->netlink_socket, &buffer, sizeof(buffer), 0); -+ if (size < 0) -+ continue; -+ - uevent = uevent_deserialize(buffer, size); - - if (uevent == NULL) -- cgit v1.2.3