Samba 4.13.14-Ubuntu panics when a connected macOS client reboots

ag flag

Just did a fresh install of Ubuntu Server 21.10 then Samba 4.13.14-Ubuntu via:

sudo apt install samba avahi-daemon

Whenever a macOS client connected to Samba reboots, I get the following email:

The Samba 'panic action' script, /usr/share/samba/panic-action,
was called for PID 24963 (/usr/sbin/smbd).

This means there was a problem with the program, such as a segfault.
Below is a backtrace for this process generated with gdb, which shows
the state of the program at the time the error occurred.  The Samba log
files may contain additional information about the problem.

If the problem persists, you are encouraged to first install the
samba-dbgsym package, which contains the debugging symbols for the Samba
binaries.  Then submit the provided information as a bug report to
Ubuntu by visiting this link:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/".
0x00007fb71b7be70f in __GI___wait4 (pid=25382, stat_loc=stat_loc@entry=0x7ffd2c2bb578, options=options@entry=0, usage=usage@entry=0x0) at ..
#0  0x00007fb71b7be70f in __GI___wait4 (pid=25382, stat_loc=stat_loc@entry=0x7ffd2c2bb578, options=options@entry=0, usage=usage@entry=0x0) a
t ../sysdeps/unix/sysv/linux/wait4.c:30
#1  0x00007fb71b7be68b in __GI___waitpid (pid=<optimized out>, stat_loc=stat_loc@entry=0x7ffd2c2bb578, options=options@entry=0) at waitpid.c
#2  0x00007fb71b72594b in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:171
#3  0x00007fb71bc4842f in smb_panic_s3 () from /lib/x86_64-linux-gnu/
#4  0x00007fb71bcb8fdb in smb_panic () from /lib/x86_64-linux-gnu/
#5  0x00007fb71bcb92b5 in ?? () from /lib/x86_64-linux-gnu/
#6  <signal handler called>
#7  0x0000000000000000 in ?? ()
#8  0x00007fb71b26448f in dbwrap_record_delete () from /usr/lib/x86_64-linux-gnu/samba/
#9  0x00007fb71be805e5 in smbXsrv_session_logoff () from /usr/lib/x86_64-linux-gnu/samba/
#10 0x00007fb71be62e17 in ?? () from /usr/lib/x86_64-linux-gnu/samba/
#11 0x00007fb71b8ff8ea in tevent_common_invoke_immediate_handler () from /lib/x86_64-linux-gnu/
#12 0x00007fb71b8ff90e in tevent_common_loop_immediate () from /lib/x86_64-linux-gnu/
#13 0x00007fb71b905760 in ?? () from /lib/x86_64-linux-gnu/
#14 0x00007fb71b903afb in ?? () from /lib/x86_64-linux-gnu/
#15 0x00007fb71b8feb28 in _tevent_loop_once () from /lib/x86_64-linux-gnu/
#16 0x00007fb71b8fee0b in tevent_common_loop_wait () from /lib/x86_64-linux-gnu/
#17 0x00007fb71b903a8b in ?? () from /lib/x86_64-linux-gnu/
#18 0x00007fb71be4cc38 in smbd_process () from /usr/lib/x86_64-linux-gnu/samba/
#19 0x000055cc54ea793d in smbd_accept_connection (ev=0x55cc551e1c20, fde=<optimized out>, flags=<optimized out>, private_data=<optimized out
>) at ../../source3/smbd/server.c:1014

#20 0x00007fb71b8ff4a1 in tevent_common_invoke_fd_handler () from /lib/x86_64-linux-gnu/
#21 0x00007fb71b90597f in ?? () from /lib/x86_64-linux-gnu/
#22 0x00007fb71b903afb in ?? () from /lib/x86_64-linux-gnu/
#23 0x00007fb71b8feb28 in _tevent_loop_once () from /lib/x86_64-linux-gnu/
#24 0x00007fb71b8fee0b in tevent_common_loop_wait () from /lib/x86_64-linux-gnu/
#25 0x00007fb71b903a8b in ?? () from /lib/x86_64-linux-gnu/
#26 0x000055cc54ea5c3b in smbd_parent_loop (parent=0x55cc551f5040, ev_ctx=0x55cc551e1c20) at ../../source3/smbd/server.c:1361
#27 main (argc=<optimized out>, argv=<optimized out>) at ../../source3/smbd/server.c:2214
A debugging session is active.

The /var/log/samba/log.smbd shows:

[2021/11/17 11:21:31.378403,  0] ../../lib/util/fault.c:159(smb_panic_log)
[2021/11/17 11:21:31.378525,  0] ../../lib/util/fault.c:160(smb_panic_log)
  INTERNAL ERROR: Signal 11: Segmentation fault in pid 24963 (4.13.14-Ubuntu)
[2021/11/17 11:21:31.378565,  0] ../../lib/util/fault.c:164(smb_panic_log)
  If you are running a recent Samba version, and if you think this problem is not yet fixed in the latest versions, please consider reporting this bug, see
[2021/11/17 11:21:31.378595,  0] ../../lib/util/fault.c:169(smb_panic_log)
[2021/11/17 11:21:31.378621,  0] ../../lib/util/fault.c:170(smb_panic_log)
  PANIC (pid 24963): Signal 11: Segmentation fault in 4.13.14-Ubuntu
[2021/11/17 11:21:31.379046,  0] ../../lib/util/fault.c:274(log_stack_trace)
  BACKTRACE: 4 stack frames:
   #0 /lib/x86_64-linux-gnu/ [0x7fb71bcb63f4]
   #1 /lib/x86_64-linux-gnu/ [0x7fb71bcb8fca]
   #2 /lib/x86_64-linux-gnu/ [0x7fb71bcb92b5]
   #3 /lib/x86_64-linux-gnu/ [0x7fb71b717520]
[2021/11/17 11:21:31.379162,  0] ../../source3/lib/util.c:838(smb_panic_s3)
  smb_panic(): calling panic action [/usr/share/samba/panic-action 24963]
gdb: warning: Couldn't determine a path for the index cache directory.
30  ../sysdeps/unix/sysv/linux/wait4.c: No such file or directory.
[2021/11/17 11:21:32.341990,  0] ../../source3/lib/util.c:845(smb_panic_s3)
  smb_panic(): action returned status 0
[2021/11/17 11:21:32.342045,  0] ../../source3/lib/dumpcore.c:317(dump_core)
  coredump is handled by helper binary specified at /proc/sys/kernel/core_pattern

My clients are macOS Monterey with the following in their /etc/nsmb.conf:

signing_required = no

My Ubuntu Server 21.10's /etc/samba/smb.conf:

allow dns updates = disabled
bind interfaces only = Yes
client min protocol = SMB3_02
dcerpc endpoint servers = rpcecho
delete veto files = Yes
disable netbios = Yes
disable spoolss = Yes
dns forwarder =
dns proxy = No
enhanced browsing = No
# Next line requires catia (needed if no Windows clients?)
fruit:encoding = native
fruit:metadata = stream
# Next line never worked which is why I configure Avahi to set the icon
;fruit:model = Macmini7
# Do not use NFS access control entries
fruit:nfs_aces = No
# Enable extended attributes (requires streams_xattr)
fruit:resource = xattr
# Next line is already the default
;fruit:zero_file_id = Yes
host msdfs = No
inherit acls = Yes
inherit permissions = Yes
interfaces = lan
lm announce = No
load printers = No
log file = /var/log/samba/log.smbd
log level = 2
logging = file
max log size = 10000
# Next 2 lines defer mDNS config to Avahi
mdns name = mdns
multicast dns register = No
name resolve order = host bcast
pam password change = Yes
panic action = /usr/share/samba/panic-action %d
passwd chat = "*New Password:*" %n\n "*Reenter New Password:*" %n\n "*Password changed.*"
passwd program = /usr/bin/passwd %u
printcap cache time = 0
printcap name = /dev/null
printing = bsd
restrict anonymous = 2
rpc_daemon:spoolssd = disabled
rpc_server:epmapper = disabled
rpc_server:winreg = disabled
rpc_server:lsarpc = disabled
rpc_server:samr = disabled
rpc_server:netlogon = disabled
rpc_server:netdfs = disabled
rpc_server:dssetup = disabled
rpc_server:wkssvc = disabled
rpc_server:spoolss = disabled
rpc_server:svcctl = disabled
rpc_server:ntsvcs = disabled
rpc_server:eventlog = disabled
rpc_server:initshutdown = disabled
rpc_server:mdssvc = disabled
server max protocol = SMB3_11
server min protocol = SMB3_02
# Next line experimental until 4.15
server multi channel support = Yes
server role = standalone server
server services = rpc, smb
server string = %h server (Samba 4.13.14, Ubuntu 21.10)
show add printer wizard = No
smb ports = 445
unix password sync = Yes
use sendfile = Yes
veto files = /._*/.DS_Store/
vfs objects = catia fruit streams_xattr

browseable = No
comment = Home Directory
fruit:time machine = No
guest ok = No
spotlight = No
valid users = %S
writable = Yes

comment = Time Machine
fruit:time machine = Yes
guest ok = No
path = /external/%U
spotlight = No
valid users = %U
writable = Yes

And for completeness, here's my /etc/avahi/services/samba.service:

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <name replace-wildcards="yes">Saint James</name>

Only need file sharing and Time Machine for the macOS Monterey clients (no Windows clients, no printing, no Active Directory, no DFS).

Anyone seeing this?

user535733 avatar
cn flag
Again, see the Debian Package Tracker link: Nobody at Debian has packaged 4.15 yet. Newer packages are being delayed by a shortage of community volunteers to do the packaging (and several important bugs). Any community volunteer willing to [learn the process]( can help solve that problem.
gp flag
Dear @nstuyvesant, I have almost the same issue while I upgraded from samba `2:4.11.6+dfsg-0ubuntu1` to `2:4.13.14+dfsg-0ubuntu0.20.04.4`. I bisected my config, and the `%u` contained share `path`s is the problem at my side. Of course, I can't avoid that, but maybe it can help.
gp flag
for the record, this samba upgrade implied the `libtalloc2` `2:4.11.6+dfsg-0ubuntu1` >> `2:4.13.14+dfsg-0ubuntu0.20.04.4` too, so I don't know which was bad.
gp flag
@nstuyvesant, try to replace the `%u` contained dynamic path with a static.
cn flag

No, you will need to install from source. Best you can get from a PPA is 4.14 (the "samba latest PPA" was not updated for 178 week days).

PANIC (pid 1772): Signal 11: Segmentation fault in 4.13.14-Ubuntu

You might get a better result with a couple more lines above and below this error. This one line did not have me find someone else with the same issue.

Segmentation faults are security bugs and as such will be back-ported into all supported releases. There faults are pretty common for samba; I have seen them in every samba version and 4.15.2 is already not perfect either so installing from source might not fix your issue. So it might be better to file bugreport and wait for an update.

ag flag

The issue was this line in my smb.conf...

server multi channel support = Yes

Apparently, this experimental feature doesn't work well prior to 4.15 (while I use macOS clients, probably happens for other types as well). Turning it off solves the issue.


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.