[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Memory leak in console-client



Hello,

In current hurd debian package there's a memory leak in 
console-client/pc-mouse.c, because the buffer allocated for device_read 
never get freed.

This is a log of what happen on my system:

After starting console I see:

hurd:~# ps -v | grep console
24131 S     134M 5.29M  0.0  1.4 console -d vga -d pc_kbd pc_kbd -d pc_mouse pc
24185 S     146M  708K  0.0  0.2 grep console
hurd:~#

After a few secs moving mouse I get 

hurd:~# ps -v | grep console
24131 S     140M 10.6M  0.0  2.8 console -d vga -d pc_kbd pc_kbd -d pc_mouse pc
24192 S     146M  708K  0.0  0.2 grep console
hurd:~#

Following patch fixes this.

Gianluca



--- hurd-orig/console-client/pc-mouse.c	2004-12-04 18:08:52.000000000 +0100
+++ hurd-new/console-client/pc-mouse.c	2004-12-04 18:17:30.000000000 +0100
@@ -237,6 +237,7 @@
       if (mouse_repeater_opened)
 	{
 	  repeat_event (ev);
+	  vm_deallocate (mach_task_self(), buf, buf_size);
 	  continue;
 	}
       
@@ -270,6 +271,7 @@
       
       /* Generate a mouse movement event.  */
       console_move_mouse (&evt);
+      vm_deallocate (mach_task_self(), buf, buf_size);
     }
 }



Reply to: