Serious Memory Leak

Bug #40174 reported by Stu Hood
24
Affects Status Importance Assigned to Milestone
brltty (Ubuntu)
Fix Released
High
Daniel Holbach

Bug Description

Under Dapper:

An update last night asked if I wanted to overwrite my brltty config, and I let it since I don't use brltty myself. Soon after the update, I restarted for a seperate reason. This morning, (12 hours later) I noticed that my memory usage was about 30% higher than usual, so I opened up the task list and saw this:
http://www.hoodidge.net/bugs/brltty-MemLeak.png

Here is my system's brltty config:
http://www.hoodidge.net/bugs/brltty.conf

I killed the process without thinking about it, but if it happens again I will get a gdb trace.

Revision history for this message
Gary Coady (garycoady) wrote :

Confirming, as I upgraded brltty this morning, and its resident memory usage was 45M (1376 bytes after restart). It uses the default brltty configuration.

Changed in brltty:
status: Unconfirmed → Confirmed
Revision history for this message
Gary Coady (garycoady) wrote :

Hmm... in BrailleDrivers/Papenmeier/ the static variable pmTerminals stores all the configuration data for the 'pm' braille driver, and this is never freed.
Whenever libbrlttybpm.so is unloaded (and this is every time detection fails), the memory stored in the static variable is leaked. The quick fix would be to disable this driver, as there is no 'cleanup memory'.
Better fix is that there should be a default function (possibly a stub) which is called by the unloadSharedObject() macro.

Revision history for this message
Gary Coady (garycoady) wrote :

This has already been seen upstream; according to http://mielke.cc/pipermail/brltty/2006-March/000713.html the following diff should be applied:
svn diff -r 2179:2181

Revision history for this message
Gary Coady (garycoady) wrote : Fix from subversion repository for leak

This fix was added to the svn repository for the leak.

Changed in brltty:
assignee: nobody → dholbach
Revision history for this message
Gary Coady (garycoady) wrote : Updated patch

This patch includes r2185, needed to fix an FTBFS since we pass --disable-pm-configfile when creating the udeb. Tested in valgrind, this leak appears to be gone (and memory usage stays steady when no braille tty is attached).

------------------------------------------------------------------------
r2185 | dave | 2006-03-24 17:12:43 +0000 (Fri, 24 Mar 2006) | 2 lines

deallocateTerminalTable() isn't available when --disable-pm-configfile is used.
(st)

Revision history for this message
Stu Hood (stuhood) wrote :

Great work Gary. Thanks a lot!

Revision history for this message
Daniel Holbach (dholbach) wrote :

 brltty (3.7.2-2ubuntu3) dapper; urgency=low
 .
   * BrailleDrivers/Papenmeier/braille.c,
     BrailleDrivers/Papenmeier/config.y,
     BrailleDrivers/Papenmeier/read_config.c,
     debian/applied-patches/fix-memleak-from-cvs.patch:
     - apply patch from CVS (Malone: #40174), thanks Gary Coady.
   * debian/brltty.init:
     - don't start brltty by default.

In addition to the patch, we disabled brltty in the init script for now, until Beta is out.

Changed in brltty:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.