On 23. okt. 2013 18:26, Gert Doering wrote:
> Hi,
> 
> On Wed, Oct 23, 2013 at 04:18:29PM +0200, Gert Doering wrote:
>>  - each further renegotiation leaks "a few kbyte" of memory per client,
>>    which should also be fully returned when the client disconnects - this
>>    is the issue I discovered earlier, with the GC handling of the per-client
>>    environment set, and I'll send a patch for that "soon" (as soon as I
>>    have fully understood the code involved).
> 
> Yeah...  Fosdem 2012 rearing it's ugly head.
> 
> Please try the following patch to git master, it should bring back 
> 2.1-behaviour here.

ACK on this patch:
-----------------------------------------------------------------------
From b56e50638f436ca7e4bcffbb0025ee9efa4244d6 Mon Sep 17 00:00:00 2001
From: Gert Doering <g...@greenie.muc.de>
List-Post: openvpn-devel@lists.sourceforge.net
Date: Wed, 23 Oct 2013 17:54:05 +0200
Subject: [PATCH] Fix slow memory drain on each client renegotiation.

This reverts commit bee92b479414d12035b0422f81ac5fcfe14fa645 and parts
of commit dc7be6d078ba106f9b0de12f3e879c3561c3c537, as these introduced a
subtle memory drain on client renegotiations (es->gc got initialized,
which led to "unused" gc_entry records accumulating while a client is
connected).

Setting es->gc=NULL causes env_set_add_nolock() / remove_env_item() to
free() allocated and no longer used strings in the es, while an active
gc would leave them for cleanup with gc_free() at client disconnect time.

Signed-off-by: Gert Doering <g...@greenie.muc.de>

Conflicts:
        src/openvpn/buffer.c
---
 src/openvpn/buffer.c  | 29 +++++++++++++++++++----------
 src/openvpn/init.c    |  2 +-
 src/openvpn/openvpn.c |  2 +-
 3 files changed, 21 insertions(+), 12 deletions(-)
-----------------------------------------------------------------------

I've primarily done a code review of this patch, confirming it restores
the important pieces back to the style of pre-v2.2.  As Brad Zhang
confirmed it also solves the memory leak, I find this good to go now.


-- 
kind regards,

David Sommerseth



Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to