Created attachment 7036 [details] Trace of smbstatus When multiple smbstatus (called from a PAM module) runs simultaneously, the processes freezes with a lock in sessionid.tdb. The problem not occurs in 3.5.x from Sernet.de. I have created a pam module that calls smbstatus and parses the output to do some checks and acts on a remote iptables/iproute firewall. Module runs fine until upgrade to 3.6.1. The strace for the process and PAM configuration are attached.
Created attachment 7037 [details] Samba PAM configuration
Links for the pam_netlogon: http://yara.ekaaty.org/projects/browser/pam_netlogon http://yara.ekaaty.org/projects/browser/Alfandega/plugins/samba
We need strace -ttT of at least to competing and deadlocking smbstatus calls
(In reply to comment #3) > We need strace -ttT of at least to competing and deadlocking smbstatus calls read this as "at least two" instead of "at least to" please
Created attachment 7038 [details] strace -ffT for 4 concurrent smbstatus calls
Created attachment 7039 [details] strace -ttT for concurrent processes Ignore previous attachment. It does a strace -ffT, not strace -ttT as required.
Can smbd processes concurrent with this too? Is that a reason to db_open sessionid.tdb with O_RDWR? Can we open file with O_RDONLY if calling process is smbstatus? From lib/sessionid_tdb.c: static struct db_context *session_db_ctx(void) { static struct db_context *session_db_ctx_ptr; if (session_db_ctx_ptr != NULL) { return session_db_ctx_ptr; } session_db_ctx_ptr = db_open(NULL, lock_path("sessionid.tdb"), 0, TDB_CLEAR_IF_FIRST|TDB_DEFAULT|TDB_INCOMPATIBLE_HASH, O_RDWR | O_CREAT, 0644); return session_db_ctx_ptr; }
There's nothing really suspicious in the straces except that the smbstatus calls wait for a lock. During that wait, can you look at 'cat /proc/locks' and see which process holds that lock, and what that does? This would assume you're running Linux...
Created attachment 7040 [details] Proposed patch No. I do not looked to 'cat /proc/locks'. But I recompiled samba with patch attached and the symptoms was gone. I'm looking now for side effects of the patch, if any exists.
The Patch is running since was applied at almost a year. This bug can be considered fixed?