Reconnecting a detached session triggers severe memory leak (due to replication?)

Bug #460093 reported by Albert Lee
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
CtrlProxy
Triaged
High
Unassigned

Bug Description

When a client reconnects to a session that was previously detached, there is an immediate increase in the heap size of the ctrlproxy process.

The increase in allocations is on the order of multiple MB in my tests on freenode with ~15 channels, even for being detached for 1 minute or less. The amount is not constant so I suspect it's related to backlog replication.

No unref'ed memory seems to account for this (I may file a separate bug for the detected leaks later), so the leaked memory is probably in a structure with unconstrained growth.

This has been reported to affect both r1900 in bzr, and 3.0.8.
Possibly same root cause as #402340.

Revision history for this message
Asheesh Laroia (paulproteus) wrote :

I just attempted to reproduce this. As far as I can tell, if Albert is right, just detaching and reattaching should grow the virtual memory map that is used as ctrlproxy's heap.

Step 1: Disconnect from ctrlproxy

(done in IRC client)

Step 2: run "pmap" to see the memory maps of the ctrlproxy process

paulproteus@rose:~ $ pmap $(pidof ctrlproxy) > /tmp/detached

Step 3: Wait 30 seconds

Step 4: Reattach to ctrlproxy

Step 5: run "pmap" to see the memory maps of the ctrlproxy process

paulproteus@rose:~ $ pmap $(pidof ctrlproxy) > /tmp/reattached

Step 6: Diff the two memory layout files

paulproteus@rose:~ $ diff /tmp/detached /tmp/reattached
5c5
< 0000000001866000 201260K rw--- [ anon ]
---
> 0000000001866000 209820K rw--- [ anon ]
109c109
< total 265916K
---
> total 274476K

You can see the files here, on the web: http://paulproteus.acm.jhu.edu/bug-report/2009-12-07/ctrlproxy/detached and http://paulproteus.acm.jhu.edu/bug-report/2009-12-07/reattached

Revision history for this message
Asheesh Laroia (paulproteus) wrote :

Forgot to say my version number:

paulproteus@rose:~ $ ctrlproxy --version
ctrlproxy 3.0.8
(c) 2002-2008 Jelmer Vernooij et al. <email address hidden>

Jelmer Vernooij (jelmer)
Changed in ctrlproxy:
status: New → Triaged
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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