Re: Possible reason for std::vector crashes

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 09 Apr 2014 04:00:46 +1200

On 9/04/2014 3:48 a.m., Tsantilas Christos wrote:
> The problem is that the peer_select code trying to access a std::vector
> which is already destroyed.
> If we call peerSelect for fwd FwdState object eg:
> peerSelect(&fwd->serverDestinations, ..., fwd);
>
> and the fwd state object become invalid (eg because client closed the
> connection) then it is possible to see this crash.
>
> I believe the fix for these cases is easy, we need to add the following
> code at the beggining of peerSelectDnsResults and peerSelectDnsPaths
> methods (and any other method uses the vector):
>
> if (!cbdataReferenceValid(psstate->callback_data)) {
> delete psstate;
> return;
> }
>
> Regards,
> Christos

Hi Christos,

 The peer_select crashes should already be fixed by trunk rev.13340 last
week which does exactly that.

Amos
Received on Tue Apr 08 2014 - 16:00:50 MDT

This archive was generated by hypermail 2.2.0 : Wed Apr 09 2014 - 12:00:12 MDT