libsmbclient multiple processes ... very confused.

Akshay V Rao avrao at
Tue Jun 17 20:12:37 GMT 2003

Well, I tried something else and found some interesting information. 
Instead of running on instance of the program set to fork 2 processes, I 
ran 2 instances of the program each set to fork 1 process each.  In this 
new case, everything ran perfectly fine.  I am still a bit confused but I 
think that this shows that the problem lies either in my program, or some 
how in libsmbclient.

Below is the tcpdump.cap.  I issued the command `tcpdump -i eth2 -s 1500 
-w tcpdump.cap host -l -n -nn` that should work.

Akshay Rao
IBM zSeries Linux Scalability Center Coop

Richard Sharpe <rsharpe at>
06/17/2003 02:54 PM

        To:     Akshay V Rao/Poughkeepsie/IBM at IBMUS
        cc:     <samba-technical at>
        Subject:        Re: libsmbclient multiple processes ... very confused.

On Tue, 17 Jun 2003, Akshay V Rao wrote:

> Description of what is to happen:
> My program forks into N child forked processes.  Each child forked 
> calls smbc_init and smbc_opendir and then proceeds to a while loop in 
> which it issues the following calls in order: smbc_readdir, smbc_open, 
> smbc_read, smbc_close.  After the while loop, it then issues a call to 
> smbc_closedir.  The N processes are all executing simultaneously, and 
> reading data from a common share.  It is at this point where the locking 

> occurs. If I only set it to fork one process (N = 1), there is no 
> problem.  Otherwise, the locking problem exists.  Below is a tcpdump of 
> processes attacking a share.

Hmmm, seems like I didn't tell you that I want a binary capture.

You can do this with 

  tcpdump -i <someint> -s 1500 -w somefile.cap

where <someint> is replaced by the interface you captured from before.

Can you try it again.

You might also view the capture in Ethereal and then you might be able to 
see what the problem is for yourself.

Richard Sharpe, rsharpe[at], rsharpe[at], 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcpdump.log
Type: application/octet-stream
Size: 11526 bytes
Desc: not available
Url :
-------------- next part --------------
A non-text attachment was scrubbed...
Type: application/zip
Size: 79635 bytes
Desc: not available
Url :

More information about the samba-technical mailing list