Why Does Samba Server Fail to Start with PANIC Error?

sambatroubleshooting

I'm seeing an error when trying to start smbd:

# smbd -i
smbd version 3.2.5 started.
Copyright Andrew Tridgell and the Samba Team 1992-2008
===============================================================
INTERNAL ERROR: Signal 6 in pid 3082 (3.2.5)
Please read the Trouble-Shooting section of the Samba3-HOWTO

From: http://www.samba.org/samba/docs/Samba3-HOWTO.pdf
===============================================================
PANIC (pid 3082): internal error
BACKTRACE: 18 stack frames:
 #0 smbd(log_stack_trace+0x1c) [0x5ae5cd]
 #1 smbd(smb_panic+0x5b) [0x5ae6db]
 #2 smbd() [0x59b1e4]
 #3 /lib/libpthread.so.0(+0xef60) [0x7fb6c8bacf60]
 #4 /lib/libc.so.6(gsignal+0x35) [0x7fb6c714f175]
 #5 /lib/libc.so.6(abort+0x180) [0x7fb6c7151f80]
 #6 /usr/lib/libtalloc.so.2(+0x2070) [0x7fb6c604f070]
 #7 /usr/lib/libtalloc.so.2(_talloc_free+0x31c) [0x7fb6c605079c]
 #8 /usr/lib/libwbclient.so.0(wbcSidToGid+0xc6) [0x7fb6c74825c6]
 #9 smbd(winbind_sid_to_gid+0x5f) [0x588735]
 #10 smbd(sid_to_gid+0xd4) [0x569918]
 #11 smbd(create_local_nt_token+0x212) [0x5eec64]
 #12 smbd(get_root_nt_token+0x116) [0x5ef191]
 #13 smbd(svcctl_init_keys+0x20) [0x4f8fa4]
 #14 smbd(registry_init_full+0xf1) [0x74f2e1]
 #15 smbd(main+0xa0e) [0x470243]
 #16 /lib/libc.so.6(__libc_start_main+0xfd) [0x7fb6c713bc4d]
 #17 smbd() [0x46ee09]
dumping core in /var/log/samba/cores/smbd
Aborted (core dumped)

When I run it from /etc/init.d/samba start I also see the above error in the /var/log/samba/log.smbd log file.

I'm using Debian Lenny (latest upgraded version). The error seemed to come from nowhere, I've been using the same setup for years now, and today samba won't start (even after rebooting). I can't think what I might have changed to cause this.

I've read the howto section as advised, but this provides only basic troubleshooting steps, nothing for an error quite as severe as this.

Best Answer

You need matching versions of libwbclient0 and samba, according to this thread on the samba list. The dependency on the Debian package is not tight enough; that's the cause of bug #593823.

(Found by googling "smbd" "winbind_sid_to_gid": since reinstalling didn't help, a library problem was next on the list of things to check.)