Solved Samba41 core dump after moving to 4.1.18

Am using FreeBSD 9.3 and was running Samba 4.1.16 nicely since February. Upgraded to 4.1.18 and I started getting samba and python2.7 core dumps using samba-tool user list (or any command). At first the log.smbd file said that it couldn't find the acl_xattr.so file. However it was right where it was supposed to be and had a length and was a hard file. Now the log file doesn't even get updated.

I installed ports-mgmt/portdowngrade, hoping to be able to get back to 4.1.16, but it only lists 4.1.18 as available. I do see 4.1.16 in /var/cache/pkg files, along with 4.1.14 and 4.1.18. I haven't had any luck adding 4.1.16 back into the db so that I could install it.

I've tried numerous things that had been suggested in the forums and from google, but to no avail. Now I have samba 4.1.18 so messed up, it core dumps right from the start command.

Would be grateful if someone knew could suggest a solution or two...
 
(I really don't know how you managed to use Samba 4.x at all. It has always coredumped for me on FreeBSD and I am not surprised here. This why I am still using 3.6.)

When I want to downgrade, I get the old ports tree and (eventually) it's direct dependencies that are tightly coupled with the software. For Samba, it would be tdb, talloc and tevent, AFAIK (not sure!). You would first install the old deps and then the old samba package using ports. How much work it is depends on luck, I guess.

You can get the old ports directories from the SVN repo, in case you are not a FreeBSD ports user.
 
Generally I have always found that compiling Samba 4 from ports always produces more reliable results. It also is better for finer grained options to be added to the system than the default assumptions from the package. If you can, I would advise compiling it first.

Also Samba 4 can be a little prickly; dependant upon the filesystem you use. Most reliable results come from using UFS.

**Please note these are my personal experiences with the software produced at different times. If I upgrade any system I usually use a test bed in something like VirtualBox before actually rolling out updates to production machines. **
 
I'm sorry you are having such problems with Samba4. I never had any issueswith it (actually I had but was my mistake). Did you compiled it or installed with pkg? Sometimes Samba coredumps with Clang. Try compile with GCC 4.7+ instead.
 
Compile with GCC 4.7+ seems scary. But I'm in so deep now, what the heck, eh? I'll let you know how it turns out. Thanks.
 
The problem also occurs in 4.0.

Samba 4 always worked fine on FreeBSD 10.x compiled with Clang. Except for the "samba-tool testparm" which stopped working years ago (Thread samba-4-update-to-4-0-12-fails.43371).

Things got broken after last update. Thanks to beadm and a ZFS rootfs I was able to return to a working version of Samba (4.0.23).

Code:
root@chariot:~ # uname -a
FreeBSD chariot.spindrift.realm 10.1-RELEASE-p17 FreeBSD 10.1-RELEASE-p17 #1: Mon Aug 17 21:27:38 BRT 2015     root@chariot.spindrift.realm:/usr/obj/usr/src/sys/GENERIC  amd64



Code:
root@chariot:~ # samba -i -M single -d3
lpcfg_load: refreshing parameters from /usr/local/etc/smb4.conf
params.c:pm_process() - Processing configuration file "/usr/local/etc/smb4.conf"
samba version 4.0.26 started.
Copyright Andrew Tridgell and the Samba Team 1992-2012
GENSEC backend 'gssapi_spnego' registered
GENSEC backend 'gssapi_krb5' registered
GENSEC backend 'gssapi_krb5_sasl' registered
GENSEC backend 'sasl-DIGEST-MD5' registered
GENSEC backend 'schannel' registered
GENSEC backend 'spnego' registered
GENSEC backend 'ntlmssp' registered
GENSEC backend 'krb5' registered
GENSEC backend 'fake_gssapi_krb5' registered
NTPTR backend 'simple_ldb'
NTVFS backend 'default' for type 1 registered
NTVFS backend 'posix' for type 1 registered
NTVFS backend 'unixuid' for type 1 registered
NTVFS backend 'unixuid' for type 3 registered
NTVFS backend 'unixuid' for type 2 registered
NTVFS backend 'cifs' for type 1 registered
NTVFS backend 'smb2' for type 1 registered
NTVFS backend 'simple' for type 1 registered
NTVFS backend 'cifsposix' for type 1 registered
NTVFS backend 'default' for type 3 registered
NTVFS backend 'default' for type 2 registered
NTVFS backend 'nbench' for type 1 registered
PROCESS_MODEL 'single' registered
PROCESS_MODEL 'onefork' registered
PROCESS_MODEL 'standard' registered
PROCESS_MODEL 'prefork' registered
AUTH backend 'sam' registered
AUTH backend 'sam_ignoredomain' registered
AUTH backend 'anonymous' registered
AUTH backend 'winbind' registered
AUTH backend 'winbind_wbclient' registered
AUTH backend 'name_to_ntstatus' registered
AUTH backend 'unix' registered
SHARE backend [classic] registered.
SHARE backend [ldb] registered.
Illegal instruction (core dumped)

Comparing with the working older version I can see that the operation after SHARE backend [ldb] registered should be ldb_wrap open of privilege.ldb. After this the samba thread starts. Could it be a problem with the LDB package?

/var/db/ports/net_samba4/options
Code:
# This file is auto-generated by 'make config'.
# Options for samba4-4.0.26
_OPTIONS_READ=samba4-4.0.26
_FILE_COMPLETE_OPTIONS_LIST=ACL_SUPPORT ADS AD_DC AIO_SUPPORT CUPS DEBUG DEVELOPER DNSUPDATE DOCS EXP_MODULES FAM LDAP MANPAGES PAM_SMBPASS PTHREADPOOL QUOTAS SWAT SYSLOG UTMP NSUPDATE BIND99 BIND910 AVAHI MDNSRESPONDER
OPTIONS_FILE_SET+=ACL_SUPPORT
OPTIONS_FILE_SET+=ADS
OPTIONS_FILE_SET+=AD_DC
OPTIONS_FILE_SET+=AIO_SUPPORT
OPTIONS_FILE_SET+=CUPS
OPTIONS_FILE_SET+=DEBUG
OPTIONS_FILE_UNSET+=DEVELOPER
OPTIONS_FILE_SET+=DNSUPDATE
OPTIONS_FILE_SET+=DOCS
OPTIONS_FILE_SET+=EXP_MODULES
OPTIONS_FILE_SET+=FAM
OPTIONS_FILE_SET+=LDAP
OPTIONS_FILE_SET+=MANPAGES
OPTIONS_FILE_SET+=PAM_SMBPASS
OPTIONS_FILE_SET+=PTHREADPOOL
OPTIONS_FILE_SET+=QUOTAS
OPTIONS_FILE_UNSET+=SWAT
OPTIONS_FILE_SET+=SYSLOG
OPTIONS_FILE_SET+=UTMP
OPTIONS_FILE_SET+=NSUPDATE
OPTIONS_FILE_UNSET+=BIND99
OPTIONS_FILE_UNSET+=BIND910
OPTIONS_FILE_UNSET+=AVAHI
OPTIONS_FILE_UNSET+=MDNSRESPONDER

/usr/local/etc/smb4.conf
Code:
[global]

    workgroup = SPINDRIFT
    realm = spindrift.realm
    netbios name = CHARIOT
    server role = active directory domain controller
    server services = +s3fs -smb +dnsupdate -nbt +ntp_signd +dns
    interfaces = 192.168.0.100 lo0
    bind interfaces only = yes
    wins support = no
    printing = bsd
    dns update command = /usr/local/sbin/samba_dnsupdate
    nsupdate command = /usr/local/bin/samba-nsupdate -g
    spn update command = /usr/local/sbin/samba_spnupdate
    allow dns updates = nonsecure
    dns forwarder = 192.168.0.254
    idmap_ldb:use rfc2307 = yes
    wide links = no
    unix extensions = yes
    unix charset = UTF8
    ea support =  yes
    inherit acls = yes
    csc policy = disable
    store dos attributes = yes
    dos filemode = no
    map read only = no
    tls enabled  = yes
    tls keyfile  = tls/XXXXXXXXX
    tls certfile = tls/XXXXXXXXX
    tls cafile   = tls/XXXXXXXXX
    aio read size = 16384
    aio write size = 16384
    socket options = TCP_NODELAY SO_SNDBUF=131072 SO_RCVBUF=131072

[netlogon]
    path = /var/db/samba4/sysvol/spindrift.realm/scripts
    read only = No


[sysvol]
    path = /var/db/samba4/sysvol
    read only = No

[homes]
    writable = yes
    browseable = no
    vfs objects = zfsacl
    nfs4:mode = special
    nfs4:acedup = merge
    nfs4:chown = yes



[srv]
    path = /zstor/srv
    writable = yes
    vfs objects = zfsacl
    nfs4:mode = special
    nfs4:acedup = merge
    nfs4:chown = yes

[pkg]
    path = /zstor/pkg
    writable = yes
    vfs objects = zfsacl
    nfs4:mode = special
    nfs4:acedup = merge
    nfs4:chown = yes

[bkp]

    path = /backup
    writable = yes
    browseable = no
    vfs objects = zfsacl
    nfs4:mode = special
    nfs4:acedup = merge
    nfs4:chown = yes



[printers]
    path = /var/spool/samba4
    printable = yes



[print$]
    path = /var/db/samba4/drivers
    comment = Printer Drivers
    writeable = yes
    vfs objects = zfsacl
    nfs4:mode = special
    nfs4:acedup = merge
    nfs4:chown = yes
 
Update:

I've updated to the latest Samba4 and some of its dependencies (py27-setuptools, py27-dnspython, talloc and libiconv) and it works as it should. Jeff I think you should look into downgrading ldb instead of Samba. You have to rebuild Samba after changing the version of its dependencies.

Update2:

I've updated all the packages except databases/ldb and net/samba4 runs fine.


It seems someone already reported the bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202565
 
What about patch databases/ldb

Code:
--- lib/replace/replace.c.orig 2015-07-22 05:32:32.000000000 +0900
+++ lib/replace/replace.c 2015-08-26 21:00:00.543526000 +0900
@@ -520,6 +520,7 @@
#ifdef HAVE_BSD_STRTOLL
long long int rep_strtoll(const char *str, char **endptr, int base)
{
+#undef strtoll
long long int nb = strtoll(str, endptr, base);
/* With glibc EINVAL is only returned if base is not ok */
if (errno == EINVAL) {

For me than no downgrade needed
 
Back
Top