Bug 12463 - Samba 4.3.11 (SMB2 or SMB3) on FreeBSD 10.3-RELEASE-p12 crashes with PANIC invalid lock_order because of lock gave errno 9 (Bad file descriptor)
Samba 4.3.11 (SMB2 or SMB3) on FreeBSD 10.3-RELEASE-p12 crashes with PANIC in...
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services
4.3.11
x64 FreeBSD
: P5 critical
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-12-07 13:40 UTC by samba
Modified: 2016-12-08 13:32 UTC (History)
1 user (show)

See Also:


Attachments
samba log file (58.15 KB, text/plain)
2016-12-07 13:40 UTC, samba
no flags Details
system log (37 bytes, text/plain)
2016-12-07 13:41 UTC, samba
no flags Details
smb4.conf (2.55 KB, text/plain)
2016-12-07 13:41 UTC, samba
no flags Details
backup file (3.76 MB, application/zip)
2016-12-07 13:42 UTC, samba
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description samba 2016-12-07 13:40:17 UTC
Created attachment 12744 [details]
samba log file

Process: 			create a backup in an asterisk appliance and store the file on a windows share.
Result:			Samba crashes on the destination server with an panic error invalid lock_order & errno 9 (Bad file descriptor)
Expected:		create & store backup file to NAS
	
Testing:			In smb4.conf  tested all combinations of "oplock" and "strict locking“
				—> nothing changed

				Separate the backup file (see attachments) and copied this from source server with smbclient …’put “…“* to destination server
				—>	without problems (same with MS Explorer or Path Finder)

				Using the build-in function of the Starface appliance to create and store the backup 
				—>	Samba crashes allways on the destination server (see attached logs); file size on dest. disc = 0 KB

				Tried to change target to other disc on NAS
				—>	Samba crashes, see above

Traceability:		Always

Additions:		No trouble with SMB access from MS Windows, Apple OSX or other Linux Machines (Ubuntu 14.04).
				Access with smbclient from Starface appliance to NAS without issues.


Source:			Phone System/Asterisk
Running as VM:	VMware vSphere 6 Essential	v. 6.0.0.

Appliance:		Starface (see www.starface.de)
OS:				CentOS 6/7/8 2.6.32-642.3.1.e16.x86_64
				Darwin Kernel Version 15.6.0:

Samba:			v. 3.6.23-35.el6_8

Java:			Server version: Apache Tomcat/6.0.24
				Server built: November 13 2015 1656
				Server number: 6.0.24.0
				OS Name: Linux
				OS Version: 2.6.32-573.7.1.el6.x86_64
				Architecture: amd64w
				JVM Version: 1.6.0_45-b06
				JVM Vendor: Sun Microsystems Inc.

Build-In:			Create SMB Mount (/mnt/....)
				(1)	==> mount /mnt/… 
						(2)	—>	if  error then stop backup and display error message
								else
								(3)	==> create temporary backup file (local disk) 
										(4)	if complete then copy the local temp backup file to the SMB share via mount point /mnt/..
											(in this case the function „FileUtils.copyFile“ will taken
											(5)	==> unmount SMB folder


Destination:		NAS Appliance
Hardware		1x Intel Sunrise Point AHCI SATA controller
				1x Seagate ST3000VX000-1CU166, 3 GB, UFS formatted, no issues S.M.A.R.T, fsck without results
				1x Seagate ST8000AS0002-1NA17Z, 8 GB UFS formatted, no issues S.M.A.R.T, fsck without results

Appliance:		NAS4FREE (see www.nas4free.org)
OS:				FreeBSD 10.3-RELEASE-p12

Samba:			v. 4.3.11

————————
shares:
BackupSysSMB:	/mnt/backupdir (ufs, NFS exported, local, journaled soft-updates, acls)
BackupNewSMB:	/mnt/BackupNew (ufs, NFS exported, local, soft-updates, acls)
logs:			/mnt/backupdir/BackupHomeServer/logs
locks:			/mnt/backupdir/samba4/
————————
attached files (set debug level to 10):
logs:			samba_28-11-2016.log
				samba-system_28-11-2016.log
config			smb4.conf
data				backup-MyDOMAIN-1480162653896.sar
Comment 1 samba 2016-12-07 13:41:00 UTC
Created attachment 12745 [details]
system log
Comment 2 samba 2016-12-07 13:41:25 UTC
Created attachment 12746 [details]
smb4.conf
Comment 3 samba 2016-12-07 13:42:03 UTC
Created attachment 12747 [details]
backup file
Comment 4 Volker Lendecke 2016-12-07 14:11:02 UTC
Does "posix locking = no" help?
Comment 5 samba 2016-12-07 19:40:55 UTC
yes, it does, in both protocols (smb2 & smb3).

The official manual https://www.samba.org/samba/docs/using_samba/ch08.html:
"On systems that support POSIX locking, Samba automatically maps oplocks to POSIX locks. This behavior can be disabled by setting posix locking = no. You should never need to change the default behavior, which is posix locking = yes."w