Samba seems to panic after enabling and connecting to ZFS backed share

Bug #2020260 reported by Adam Baxter
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Windows clients lock up while connecting to the server, and the server logs the following:

```
  ===============================================================
[2023/05/21 10:08:50.500473, 0] ../../lib/util/fault.c:174(smb_panic_log)
  INTERNAL ERROR: Signal 11: Segmentation fault in pid 4223 (4.17.7-Ubuntu)
[2023/05/21 10:08:50.500476, 0] ../../lib/util/fault.c:178(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 https://wiki.samba.org/index.php/Bug_Reporting
[2023/05/21 10:08:50.500479, 0] ../../lib/util/fault.c:183(smb_panic_log)
  ===============================================================
[2023/05/21 10:08:50.500482, 0] ../../lib/util/fault.c:184(smb_panic_log)
  PANIC (pid 4223): Signal 11: Segmentation fault in 4.17.7-Ubuntu
[2023/05/21 10:08:50.500661, 0] ../../lib/util/fault.c:292(log_stack_trace)
  BACKTRACE: 32 stack frames:
   #0 /usr/lib/x86_64-linux-gnu/samba/libgenrand-samba4.so.0(log_stack_trace+0x32) [0x7f33665d04d2]
   #1 /usr/lib/x86_64-linux-gnu/samba/libgenrand-samba4.so.0(smb_panic+0xd) [0x7f33665d0a8d]
   #2 /usr/lib/x86_64-linux-gnu/samba/libgenrand-samba4.so.0(+0x1b25) [0x7f33665d0b25]
   #3 /lib/x86_64-linux-gnu/libc.so.6(+0x3c4b0) [0x7f336623c4b0]
   #4 /lib/x86_64-linux-gnu/libc.so.6(+0x173b1d) [0x7f3366373b1d]
   #5 /lib/x86_64-linux-gnu/libsamba-util.so.0(push_ucs2_talloc+0x22) [0x7f336682b7a2]
   #6 /usr/lib/x86_64-linux-gnu/samba/libcliauth-samba4.so.0(E_md4hash+0x36) [0x7f3366891d56]
   #7 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-samba4.so.0(create_volume_objectid+0x53) [0x7f33669bc2a3]
   #8 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-samba4.so.0(+0x3c2f8) [0x7f33669972f8]
   #9 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-samba4.so.0(smb2_ioctl_filesys+0x503) [0x7f3366a13393]
   #10 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-samba4.so.0(smbd_smb2_request_process_ioctl+0x3f3) [0x7f3366a156d3]
   #11 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-samba4.so.0(smbd_smb2_request_dispatch+0x10f2) [0x7f3366a03fa2]
   #12 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-samba4.so.0(smbd_smb2_request_dispatch_immediate+0x50) [0x7f3366a055a0]
   #13 /lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_invoke_immediate_handler+0x182) [0x7f336657b082]
   #14 /lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_loop_immediate+0x1a) [0x7f336657b0aa]
   #15 /lib/x86_64-linux-gnu/libtevent.so.0(+0xd91f) [0x7f336657e91f]
   #16 /lib/x86_64-linux-gnu/libtevent.so.0(+0x5eeb) [0x7f3366576eeb]
   #17 /lib/x86_64-linux-gnu/libtevent.so.0(_tevent_loop_once+0x95) [0x7f33665792b5]
   #18 /lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_loop_wait+0x1b) [0x7f33665793cb]
   #19 /lib/x86_64-linux-gnu/libtevent.so.0(+0x5f5b) [0x7f3366576f5b]
   #20 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-samba4.so.0(smbd_process+0x7ec) [0x7f33669f1b4c]
   #21 /usr/sbin/smbd(+0xa390) [0x556163d14390]
   #22 /lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_invoke_fd_handler+0x95) [0x7f336657ae45]
   #23 /lib/x86_64-linux-gnu/libtevent.so.0(+0xdb37) [0x7f336657eb37]
   #24 /lib/x86_64-linux-gnu/libtevent.so.0(+0x5eeb) [0x7f3366576eeb]
   #25 /lib/x86_64-linux-gnu/libtevent.so.0(_tevent_loop_once+0x95) [0x7f33665792b5]
   #26 /lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_loop_wait+0x1b) [0x7f33665793cb]
   #27 /lib/x86_64-linux-gnu/libtevent.so.0(+0x5f5b) [0x7f3366576f5b]
   #28 /usr/sbin/smbd(main+0x148d) [0x556163d1200d]
   #29 /lib/x86_64-linux-gnu/libc.so.6(+0x23a90) [0x7f3366223a90]
   #30 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x89) [0x7f3366223b49]
   #31 /usr/sbin/smbd(_start+0x25) [0x556163d128f5]
[2023/05/21 10:08:50.500708, 0] ../../source3/lib/util.c:702(smb_panic_s3)
  smb_panic(): calling panic action [/usr/share/samba/panic-action 4223]
[2023/05/21 10:08:50.501441, 0] ../../source3/lib/util.c:709(smb_panic_s3)
  smb_panic(): action returned status 0
[2023/05/21 10:08:50.501455, 0] ../../source3/lib/dumpcore.c:317(dump_core)
  coredump is handled by helper binary specified at /proc/sys/kernel/core_pattern
```

ProblemType: Bug
DistroRelease: Ubuntu 23.04
Package: samba 2:4.17.7+dfsg-1ubuntu1
ProcVersionSignature: Ubuntu 6.2.0-20.20-generic 6.2.6
Uname: Linux 6.2.0-20-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.26.1-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CloudArchitecture: x86_64
CloudID: none
CloudName: none
CloudPlatform: none
CloudSubPlatform: config
Date: Sun May 21 10:17:20 2023
InstallationDate: Installed on 2023-05-21 (0 days ago)
InstallationMedia: Ubuntu-Server 23.04 "Lunar Lobster" - Release amd64 (20230415)
NmbdLog:

ProcEnviron:
 LANG=C.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=tmux-256color
SambaServerRegression: Yes
SmbConfIncluded: Yes
SmbLog:

SourcePackage: samba
TestparmExitCode: 0
UbuntuFailedConnect: Yes
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Adam Baxter (voltagex) wrote :
Revision history for this message
Olivier Duclos (odc) wrote :

I suspect this is a similar issue: https://www.spinics.net/lists/samba/msg178751.html

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

The smb.conf file attached to this ticket is the default one, I don't see any share there.

Do you have any special options in the share that exports the zfs dataset? Perhaps a vfs module, or some other setting?

I tried a simple scenario here with a dataset exported as a share, and an authenticated user connecting to it with smbclient, and it worked fine. I know you said that a windows client connected when the crash occurred, but before bringing up a windows VM to test, it would be good to know more details about the share and any other configuration changes from the default.

Changed in samba (Ubuntu):
status: New → Incomplete
Revision history for this message
Adam Baxter (voltagex) wrote :

I think zfs set sharesmb uses the usershare functionality.

Revision history for this message
Paride Legovini (paride) wrote :

Hello, I quickly tried to setup a share using `zfs set sambashare=on <dataset>` in a Lunar VM and samba didn't crash, however I wouldn't call this a fully proper test, as I don't have a Windows machine handy to try to mount the share there.

I have however another few questions on your issue:

* I see you're using Lunar Did it work with other (previous) Ubuntu releases?

* When does the crash happen exactly? Do you need to actually try to access data from the Windows machine?

* Can you by any chance test if the crash still happens with the Ubuntu development release (mantic)?

Thanks!

Revision history for this message
Adam Baxter (voltagex) wrote :

Infuriatingly I could not reproduce the crash with a new Lunar VM or on the original VM where the crash had occurred.

I can't get GDB to give me that backtrace from the coredump, either, even with -dbgsym packages and debuginfod enabled.

I guess this means this bug report will need to be closed.

The commands I used to create the pool, dataset and share:

sudo zpool create -O compress=zstd-10 -O dedup=on pool /dev/sdb
sudo zfs create pool/data
sudo zfs set pool/data sharesmb=on
sudo chmod 777 /pool/data/

* I see you're using Lunar Did it work with other (previous) Ubuntu releases?

I don't think I've used sharesmb in any other releases, I have a 22.04.2 LTS box that's been running flawlessly for years

* When does the crash happen exactly? Do you need to actually try to access data from the Windows machine?

All I needed to do originally was try to create a folder or file.

Thanks all for your time.

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the quick reply and for trying hard to reproduce the issue, Adam.

I think it's fine to leave this bug as Incomplete for now. If you find yourself facing the same issue again, please feel free to come back to this bug and provide an update for us.

Thanks a lot.

Bryce Harrington (bryce)
Changed in samba (Ubuntu):
status: Incomplete → New
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for samba (Ubuntu) because there has been no activity for 60 days.]

Changed in samba (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Pedro Rodrigues (pcumracl) wrote :
Download full text (4.3 KiB)

Hi
I am not using Ubunto but debian bookworm instead, however experiencing the same problem.
The original log report seems a copy paste of mine that follows

[2024/01/04 13:41:56.469834, 0] ../../source3/param/loadparm.c:3461(process_usershare_file)
  process_usershare_file: stat of /var/lib/samba/usershares/hpool_xrf failed. Permissão recusada
[2024/01/04 13:41:56.583844, 0] ../../lib/util/fault.c:173(smb_panic_log)
  ===============================================================
[2024/01/04 13:41:56.583865, 0] ../../lib/util/fault.c:174(smb_panic_log)
  INTERNAL ERROR: Signal 11: Falta de segmentação in pid 1659648 (4.17.12-Debian)
[2024/01/04 13:41:56.583874, 0] ../../lib/util/fault.c:178(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 https://wiki.samba.org/index.php/Bug_Reporting
[2024/01/04 13:41:56.583890, 0] ../../lib/util/fault.c:183(smb_panic_log)
  ===============================================================
[2024/01/04 13:41:56.583896, 0] ../../lib/util/fault.c:184(smb_panic_log)
  PANIC (pid 1659648): Signal 11: Falta de segmentação in 4.17.12-Debian
[2024/01/04 13:41:56.584103, 0] ../../lib/util/fault.c:292(log_stack_trace)
  BACKTRACE: 32 stack frames:
   #0 /usr/lib/x86_64-linux-gnu/samba/libgenrand-samba4.so.0(log_stack_trace+0x2e) [0x7f7a983c455e]
   #1 /usr/lib/x86_64-linux-gnu/samba/libgenrand-samba4.so.0(smb_panic+0x9) [0x7f7a983c47b9]
   #2 /usr/lib/x86_64-linux-gnu/samba/libgenrand-samba4.so.0(+0x1851) [0x7f7a983c4851]
   #3 /lib/x86_64-linux-gnu/libc.so.6(+0x3bfd0) [0x7f7a981bcfd0]
   #4 /lib/x86_64-linux-gnu/libc.so.6(+0x155d59) [0x7f7a982d6d59]
   #5 /lib/x86_64-linux-gnu/libsamba-util.so.0(push_ucs2_talloc+0x1e) [0x7f7a98620c0e]
   #6 /usr/lib/x86_64-linux-gnu/samba/libcliauth-samba4.so.0(E_md4hash+0x32) [0x7f7a9868b4a2]
   #7 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-samba4.so.0(create_volume_objectid+0x4f) [0x7f7a987bf3cf]
   #8 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-samba4.so.0(+0x3c968) [0x7f7a98791968]
   #9 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-samba4.so.0(smb2_ioctl_filesys+0x503) [0x7f7a98817a83]
   #10 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-samba4.so.0(smbd_smb2_request_process_ioctl+0x3e3) [0x7f7a98816c23]
   #11 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-samba4.so.0(smbd_smb2_request_dispatch+0x10e2) [0x7f7a98805592]
   #12 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base-samba4.so.0(smbd_smb2_request_dispatch_immediate+0x4c) [0x7f7a98806b8c]
   #13 /lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_invoke_immediate_handler+0x17a) [0x7f7a9836ae2a]
   #14 /lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_loop_immediate+0x16) [0x7f7a9836ae46]
   #15 /lib/x86_64-linux-gnu/libtevent.so.0(+0xebfb) [0x7f7a98370bfb]
   #16 /lib/x86_64-linux-gnu/libtevent.so.0(+0xcef7) [0x7f7a9836eef7]
   #17 /lib/x86_64-linux-gnu/libtevent.so.0(_tevent_loop_once+0x91) [0x7f7a98369ba1]
   #18 /lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_loop_wait+0x1b) [0x7f7a98369e7b]
   #19 /lib/x86_64-linux-gnu/libtevent.so.0(+0xce97) [0x7f7a9836ee97]
   #20 /usr/lib/x86_64-linux-gnu/s...

Read more...

Revision history for this message
Robie Basak (racb) wrote :

Sorry, I don't think this report can make any more progress without steps to reproduce on Ubuntu or a deeper technical analysis.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.