Samba 2.0.6 fix causing problems

Jeremy Allison jeremy at
Fri Jan 7 19:33:42 GMT 2000

Marc Jacobsen wrote:

> The locking_init() function eventually calls smb_shm_register_process().  On
> both 2.0.5a and 2.0.6, when a connection is closed smb_shm_unregister_process()
> gets called by the child smbd process.  For 2.0.5a this is fine, each child smbd
> process calls smb_shm_register_process() and then later
> smb_shm_unregister_process().  But with 2.0.6, only the parent smbd process
> calls smb_shm_register_process() and every child process calls
> smb_shm_unregister_process() resulting in an error message like this in the log
> file:
> log.client:  ERROR smb_shm_unregister_process : couldn't find pid 1282 in file
> /var/opt/samba/locks/SHARE_MEM_FILE.processes
> I imagine that since none of the child smbd processes is properly locking shared
> memory this error message is the least of our worries.

Well actually the child processes are locking the shared memory
correctly as they use semaphores to do this (none of which are
locked at fork time and so are correctly inherited), it's just that they're
not de-initialising properly.

> I know there must be some reason that the order of locking_init() and
> open_sockets() was switched, but I can't figure it out.  I looked through the
> list of fixes in 2.0.6 in the WHATSNEW file, but didn't find any obvious
> correlation.
> I don't want to break anything by switching this back, so could someone please
> tell me why this change was made?

As I recall I made this change to fix the initialising shared
memory errors that many people reported with 2.0.5a (ie. this
is my fault - I'm owning up to it).

I will revert this to after the fork - the extra code that
got added to the shm_open functions should have fixed the
init problem anyway - I was trying for a 'belt and braces'
approach and screwed up :-(.

Thanks for pointing this out.


Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba-technical mailing list