Volker.Lendecke at SerNet.DE
Sun Aug 13 07:35:47 GMT 2006
On Sat, Aug 12, 2006 at 08:46:12PM -0400, simo wrote:
> This simply untrue, as I said we are not yet bothering with non-Linux
> platforms, but the Samba4 code always build in the platforms we use.
> And usually it doe not break because you are required to run make test
> before committing.
From my point of view putting in portability as an
afterthought only is a mistake. What I have seen in Samba3
is that going through all the warnings of the different
compilers pointed out areas of code that actually were
buggy. It is very tedious and boring work at times, but in
the longer run it leads to much cleaner code.
> And this happens because at some levels mixing the old style samba3 code
> with a hierarchical based one without clear separation or constraints is
> not the right thing to do. You cannot drop in talloc in a portion of
> code that use a lot of global or stack allocated structures, and does
> not have a clear hierarchical memory model. I agree in fact that in most
> samba3 code talloc_steal should not be used, or should be used with
> extreme care.
Where in Samba4's libcli/raw do you see a mix of global
variables and stack allocated structures being mixed? When
writing the beginnings of winbind I had to make use of
libcli/ in its full beauty. It happened several times to me
that I spent hours on talloc hierarchy problems and could
not figure out what I had done wrong. I had to ask tridge to
help me. This is what I mean with very subtle code.
For example at this moment I have the problem that I can not
run base-disconnect with --num-ops more than 800ish because
I run out of file descriptors. Not the sockets but the epoll
handlers are not freed. All that test does is a
torture_open_connection and a talloc_free on the resulting
cli struct. I would expect all resources to be freed.
Asked metze, and he tells me that this is an invalid use of
the cli struct, I have to use a single event context for all
the client connections.
Where is this documented? In the code? It is this kind of
restrictions that are extremely subtle to figure out, at
least to me. It is *not* obvious from the code.
I've run across these kinds of bugs in my little portion of
Samba4 code much too often.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20060813/fcee9cf9/attachment.bin
More information about the samba-technical