[PATCH] Fix intermittent crash in NTVFS server.
Jeremy Allison
jra at samba.org
Sat Apr 1 18:39:44 UTC 2017
On Sun, Apr 02, 2017 at 06:23:46AM +1200, Andrew Bartlett via samba-technical wrote:
> On Sat, 2017-04-01 at 14:15 -0400, Jim Brown via samba-technical wrote:
> > You should add "/* NOT REACHED */" after model_ops->terminate() to
> > show
> > control never returns from this call.
> >
> > Do any other callers of model_ops->terminate() assume control
> > returns?
>
> Thanks for taking the time to look over our patches!
>
> In this case it is a little more tricky than that, it can return if the
> server is in single process mode (which tries to be a giant state
> machine).
>
> /* called when a task goes down */
> static void single_terminate(struct tevent_context *ev, struct
> loadparm_context *lp_ctx, const char *reason)
> {
> DEBUG(3,("single_terminate: reason[%s]\n",reason));
> }
>
> Thanks,
Yep, but that doesn't affect this patch (which fixes
the "standard" process mode). For the single process
mode it does:
model_ops->terminate()
talloc_free(srv_conn);
as single_terminate() actually does return.
So changing the order of these calls doesn't
change anything for the "single" process mode.
It's only the standard_terminate() call that does:
talloc_free(event_ctx);
exit(0)
So this patch is good for both the "single" and "standard"
process mode (and it certainly eliminates the reproducible
crash !).
Cheers,
Jeremy.
More information about the samba-technical
mailing list