Created attachment 16481 [details]
gdb stack trace
When I restart smbd on some of our more busy servers (ca 1500 smbd processes), sometimes I get a number of core dumps from the terminating smbd:s.
Using gdb and doing a stack trace (I recompiled samba with the tdb library internally without optimization) I noticed that it was crashing in pthread_mutex_unlock() while doing some cleanups before exiting.
(See attached file).
This sounds _very_ similar to:
so it might be a FreeBSD bug but who knows...
With "dbwrap_tdb_mutexes:* = no" no more core dumps have been seen and things
seem to work fine. Might be good to know for other FreeBSD users if they run into the same stuff.
(Since it was during restarts of samba it wasn't generally that big an issue, until it started filling up my /var/cores directory :-)
https://bugs.openldap.org/show_bug.cgi?id=9278 also is an issue with robust mutexes on FreeBSD. Just for reference, not sure there are any other similarities.
(In reply to Peter Eriksson from comment #0)
> When I restart smbd on some of our more busy servers (ca 1500 smbd
> processes), sometimes I get a number of core dumps from the terminating
As discussed in 14636: Is it possible that the new smbd parent already started while other smbds are still shutting down?
Hmm. Very possible. If not even guaranteed. I'll make some tests with the "wait-for-all-to-die-when-restarting"-fix in place and with dbwrap-enabled.
Ok, ran a short (10 minutes) tests of continuous restarts-with-wait-for-all-smbd-to-exit with 100-clients on two of my test servers with dbwrap-mutexes enabled and no core dumps. So looking good.