Deadlock with libsmbclient functions and Multiple forked processes

Andrew Bartlett abartlet at
Fri Jun 13 00:14:12 GMT 2003

On Fri, 2003-06-13 at 06:08, Akshay V Rao wrote:
> I am currently developing a program that forks N Processes.  Each child
> forked process, executes a while loop in which the following function calls
> are issued in the following order: smbc_open(), smbc_read(), smbc_close().
> It appears that these functions are responsible for creating deadlocks when
> there exist more than one child forked process (N > 1).  If I comment out
> the function calls and run the program with multiple processes, the
> deadlock is gone and the program runs normally.  If I then uncomment the
> function calls and run the program with only one process, the deadlock is
> gone as well.  I am running Samba version 2.2.7a on RedHat 7.3 kernel
> version 2.4.7-10smp, 512 Mb RAM, Dual PIII.  If anyone has any ideas, they
> would definitly be greatly appreciated.

If you are doing this on one connection to the remote server, I'm not
surprised.  The libsmbclient code will still share the connection after
initialization, and you are reading/writing from a common socket!

Don't do that.  We are not thread-safe either.

Andrew Bartlett

Andrew Bartlett                                 abartlet at
Manager, Authentication Subsystems, Samba Team  abartlet at
Student Network Administrator, Hawker College   abartlet at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url :

More information about the samba-technical mailing list