> -----Original Message-----
> From: Yann Ylavic [mailto:ylavic....@gmail.com]
> Sent: Mittwoch, 28. Mai 2014 12:38
> To: httpd
> Subject: Re: Memory leak in mod_ssl ssl_callback_TmpDH
> 
> On Wed, May 28, 2014 at 9:18 AM, Plüm, Rüdiger, Vodafone Group
> <ruediger.pl...@vodafone.com> wrote:
> >
> >
> >> -----Original Message-----
> >> From: Yann Ylavic [mailto:ylavic....@gmail.com]
> >> Sent: Mittwoch, 28. Mai 2014 01:25
> >> To: httpd
> >> Subject: Re: Memory leak in mod_ssl ssl_callback_TmpDH
> >>
> >> On Tue, May 27, 2014 at 10:33 PM, Ruediger Pluem <rpl...@apache.org>
> >> wrote:
> >> >
> >> >  #define make_get_dh(rfc,size,gen) \
> >> >  static DH *get_dh##size(void) \
> >> > @@ -1339,7 +1344,7 @@
> >> >          DH_free(dh_tmp); \
> >> >          return NULL; \
> >> >      } \
> >> > -    dh = dh_tmp; \
> >> > +    apr_atomic_xchgptr((volatile void **)&dh, dh_tmp); \
> >> >      return dh; \
> >> >  }
> >> >
> >>
> >> I think you still need to handle the race (leak) with something like :
> >
> > To be honest I am not worried about the leak as it is very limited and
> does not harm.
> 
> Well, "fixing" it does not harm too much either (and quiets valgrind a
> bit, this has potential #cores leaks).
> We probably need an #include "apr_atomic.h" at the top too...
> 

Well if we see it this strict I would prefer Joe's original proposal and do 
that stuff
during initialisation, even if we don't need that parameters at all. IMHO 
generating them is cheap during
init phase such we only hand out the existing stuff in the callback later on.
But it requires some moving of code.


Regards

Rüdiger

Reply via email to