Bugs in libsmbclient (was Re: Are code assertions considered
rsharpe at richardsharpe.com
Sun Nov 9 07:07:15 GMT 2003
On Sun, 9 Nov 2003, Cameron Paine wrote:
> My observation was intended as a discussion point. Specific
> instances in the client library code are to be the subject of
> some future patch submissions. However, lest you think I'm
> ducking and weaving, here's a few, albeit trivial, examples.
> 1. ignores its logging argument
> 2. sets errno and returns -1 on most errors.
> 3. returns an errno.h constant if it cannot allocate
> the file table.
> 1. sets errno and returns -1 on most errors.
> 2. returns 1 if it falls out the bottom (currently it can't
> do that but...)
> 3. returns a descriptor on success
> smbc_getatr (a function declared as returning a BOOL):
> 1. sets errno and returns -1 on one error.
> 2. doesn't set errno and returns False on another error.
> 3. returns True on success.
These should be logged as bugs at bugzilla.samba.org. That will ensure
that your findings are not forgotten and a larger pool of people can work
If you have tests that expose these bugs, it would be useful to provide
the code for the tests as well.
> I have four failure modes; one we've discussed (you may recall I
> forwarded you some session captures):
> Memory management. I was losing 16-20 KB every time I visited
> a server. I know memory is cheap these days, but... :-) I
> found a fix proposed to this mailing list by "Ong Kian Win"
> (codegrunt at rubbercookie.com) back in Feb 2002. So far, it has
> worked for me. I'm bothered though that you declined to
> integrate it. Why was that? What side-effects await me?
> Inconsistent opendir returns. This is the one I referred to you.
> Essentially smbc_opendir returns varying numbers of files from
> a share that is not changing. I have a hack in place that's
> keeping this end of the universe propped up until I get advice
> from you. It's not (currently) urgent but I don't want to give
> my customers a solution that contains a hack that I don't
> Silent death. The process simply dies. The frequency varies. By
> carefully adding additional trace messages I'm generating logs
> that are starting to point to the problem. I've narrowed it down
> to clientgen.c:cli_send_smb(). This is a work in progress.
> Transport layer errors don't propagate upwards. When this one
> bites I cannot continue transactions with the target server
> unless I shut down the process. There seems to be some persistent,
> per-server state that is maintained that I won't pretend to
> I've added enough trace code to let me identify the "trigger"
> event. I don't fully understand the implication of what I'm
> about to tell you. A typical scenario goes like this:
Please log these as well.
Richard Sharpe, rsharpe[at]ns.aus.com, rsharpe[at]samba.org,
More information about the samba-technical