smbd child process dumps core on exit

Daniel Gan-Levi DANIELG at
Tue Jul 9 23:56:36 MDT 2013

I've had some instances where smbd child process dumps core while closing
connection on exit. The culprit seems to be that when it tries to exit
cleanly, the share directory is already deleted (this is after the share is
removed from the configuration and SIGHUP is sent to smbd to re-read it).
In smbXsrv_tcon_disconnect(), set_current_service() gets called with
do_chdir=true, and since the directory is already not there, it fails. This
failure bubbles up to exit_server_common(), where it causes dump_core() to
be called. Changing the call to set_current_service() with do_chdir=false
makes the core dump events disappear. Before I file this in bugzilla, I
would like to understand it better, so I have 2 questions:
1. Child smbd processes serving shares removed from the configuration can
continue living for some time, is my understanding correct?
2. Is chdir really needed in smbXsrv_tcon_disconnect() in general? If yes,
is it still needed when smbXsrv_tcon_disconnect() gets called from
exit_server_common() ?

More information about the samba-technical mailing list