[Swan-dev] crash after pluto: Fix addresspool reference count

Antony Antony antony at phenome.org
Thu Oct 5 18:18:41 UTC 2017


Wow, this patch looks like a heavy hammer solution. To reference count the 
pool for each lease? There is something else going on. I imagine reproducing 
#299 will give more info. Also wonder no unrefrence when the lease goes 
away. Did you check for memory leak after this patch? 

Thanks for the proposed patch, it gave a bit more insight into the issue.

-antony


On Thu, Oct 05, 2017 at 02:52:06PM +0200, Wolfgang Nothdurft wrote:
> Am 05.10.2017 um 10:13 schrieb Antony Antony:
> > Hi Wolfgang,
> > 
> > Thanks for the config so far I only looked at test run result.
> > 
> > Test run shutdown crash after Paul applied the patch bd3a5f01e7c5c7ced
> > Here is the backtrace I see:
> > https://swantest.libreswan.fi/results/blackswan/2017-10-03-swantest-3.22dr2-487-gaa90cdeb8-master/xauth-pluto-16/OUTPUT/east.core.txt
> > 
> > Could please get some more information?
> > Are you running 3.21 + patch or librewan master? Could you do a quick test
> > with your patch "ipsec stop". Does it crash?
> > 
> > If it does not crash not crash for you, please another test with
> > "plutodebug=all"
> > 
> > Just bring up the connection and "ipsec stop"
> 
> The problem is that now with the removed leaking reference_addresspool in
> connections.c the address pool is freed to early and therefore crashed on
> stop.
> 
> So it needs another references when a lease is given (see attached patch).
> 
> But there is another problem. A pending connection from the initiator can
> delete the addresspool, because the unreference_addresspool is called every
> time a instance is deleted, even if it haven't increased the pool_refcount
> by itself.
> So if you restart the server the addresspool is initialised and the
> initiator can delete the addresspool when trying to reconnect without
> referencing it.
> 
> So the unreference_addresspool has to move from connection.c or called only
> if it is sure that the connection has referenced the addresspool.
> 
> 
> 




More information about the Swan-dev mailing list