[PATCH] Cache messaging dgm connections

Jeremy Allison jra at samba.org
Sat Sep 17 21:39:27 UTC 2016


On Sat, Sep 17, 2016 at 10:33:42PM +0200, Ralph Böhme wrote:
> Hi,
> 
> On Sat, Sep 17, 2016 at 01:35:14AM -0700, Jeremy Allison wrote:
> > So here is the full patchset I'm testing with.
> 
> ah, there it is. :)
> 
> > I have a good feeling about this one (when
> > running with the canary debug patch on top
> > of the last patch that fixes the logic for
> > looking for a free context slot I saw much
> > fewer EV CONTEXT debug messages)....
> > 
> > I'll leave this running overnight and check
> > up in the morning.
> 
> I'll start one as well.
> 
> 
> > +	/* Look for an existing match first. */
> >  	for (i=0; i<num_contexts; i++) {
> >  		struct poll_funcs_tevent_context *ctx = state->contexts[i];
> >  
> > -		if ((ctx == NULL) || (ctx->ev == ev)) {
> > +		if (ctx != NULL && ctx->ev == ev) {
> > +			*slot = i;
> > +			return true;
> > +		}
> > +	}
> > +
> > +	/* Now look for a free slot. */
> > +	for (i=0; i<num_contexts; i++) {
> > +		struct poll_funcs_tevent_context *ctx = state->contexts[i];
> > +
> > +		if (ctx == NULL) {
> 
> d'oh! It was right in front of me multiple times and I didn't spot
> it. Great catch! I really hope this is it finally.

Yeah, I'm pretty sure this is it. Damn hard to find though,
I reviewed this code originally and have been staring at
it for more than 2 days now and didn't see it until last
night :-).

It explains the second free of the poll_funcs_tevent_context
that causes the crashes we've been seeing.



More information about the samba-technical mailing list