Bug 215859 - net/samba36: upgrade of talloc/tevent/tdb to talloc-2.1.8 tevent-0.9.31 tdb-1.3.12,1 breaks samba36-3.6.25_3
Summary: net/samba36: upgrade of talloc/tevent/tdb to talloc-2.1.8 tevent-0.9.31 tdb-1...
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Timur I. Bakeyev
URL:
Keywords:
: 216528 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-01-07 18:53 UTC by Martin Birgmeier
Modified: 2017-12-18 04:43 UTC (History)
8 users (show)

See Also:
bugzilla: maintainer-feedback? (timur)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2017-01-07 18:53:48 UTC
The recent upgrade of (probably one of) talloc/tevent/tdb breaks samba, specifically smbd.

I tried rebuilding samba36, to no avail.

The interesting part may be "Bad talloc magic value - unknown value" in the second log below.

log.smbd shows the following:

[2017/01/07 18:16:30,  0] smbd/server.c:1072(main)
  smbd version 3.6.25 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2011
[2017/01/07 18:16:30.895072,  0] lib/fault.c:51(fault_report)
  ===============================================================
[2017/01/07 18:16:30.895237,  0] lib/fault.c:52(fault_report)
  INTERNAL ERROR: Signal 11 in pid 99933 (3.6.25)
  Please read the Trouble-Shooting section of the Samba3-HOWTO
[2017/01/07 18:16:30.895266,  0] lib/fault.c:54(fault_report)
  
  From: http://www.samba.org/samba/docs/Samba3-HOWTO.pdf
[2017/01/07 18:16:30.895321,  0] lib/fault.c:55(fault_report)
  ===============================================================
[2017/01/07 18:16:30.895341,  0] lib/util.c:1117(smb_panic)
  PANIC (pid 99933): internal error
[2017/01/07 18:16:30.910685,  0] lib/util.c:1221(log_stack_trace)
  BACKTRACE: 5 stack frames:
   #0 0x1409188 <log_stack_trace+0x28> at /usr/local/sbin/smbd
   #1 0x1408a92 <smb_panic+0x52> at /usr/local/sbin/smbd
   #2 0x13f94d0 <fault_setup+0x190> at /usr/local/sbin/smbd
   #3 0x802ded78f <pthread_sigmask+0x4ff> at /lib/libthr.so.3
   #4 0x802decd6f <pthread_getspecific+0xe9f> at /lib/libthr.so.3
[2017/01/07 18:16:30.910851,  0] lib/fault.c:416(dump_core)
  dumping core in /var/log/samba/cores/smbd
[2017/01/07 18:16:30.913026,  0] lib/fault.c:51(fault_report)
  ===============================================================
[2017/01/07 18:16:30.913083,  0] lib/fault.c:52(fault_report)
  INTERNAL ERROR: Signal 11 in pid 99928 (3.6.25)
  Please read the Trouble-Shooting section of the Samba3-HOWTO
[2017/01/07 18:16:30.913110,  0] lib/fault.c:54(fault_report)
  
  From: http://www.samba.org/samba/docs/Samba3-HOWTO.pdf
[2017/01/07 18:16:30.913135,  0] lib/fault.c:55(fault_report)
  ===============================================================
[2017/01/07 18:16:30.913156,  0] lib/util.c:1117(smb_panic)
  PANIC (pid 99928): internal error
[2017/01/07 18:16:30.927939,  0] lib/util.c:1221(log_stack_trace)
  BACKTRACE: 5 stack frames:
   #0 0x1409188 <log_stack_trace+0x28> at /usr/local/sbin/smbd
   #1 0x1408a92 <smb_panic+0x52> at /usr/local/sbin/smbd
   #2 0x13f94d0 <fault_setup+0x190> at /usr/local/sbin/smbd
   #3 0x802ded78f <pthread_sigmask+0x4ff> at /lib/libthr.so.3
   #4 0x802decd6f <pthread_getspecific+0xe9f> at /lib/libthr.so.3
[2017/01/07 18:16:30.928086,  0] lib/fault.c:416(dump_core)
  dumping core in /var/log/samba/cores/smbd

After cleaning /var/db/samba, log.smbd changes to:

[2017/01/07 19:26:18.661062,  0] ../lib/util/debug.c:413(talloc_log_fn)
  Bad talloc magic value - unknown value
[2017/01/07 19:26:18.661179,  0] lib/util.c:1117(smb_panic)
  PANIC (pid 2024): Bad talloc magic value - unknown value
[2017/01/07 19:26:18.672698,  0] lib/fault.c:51(fault_report)
  ===============================================================
[2017/01/07 19:26:18.672898,  0] lib/fault.c:52(fault_report)
  INTERNAL ERROR: Signal 11 in pid 2171 (3.6.25)
  Please read the Trouble-Shooting section of the Samba3-HOWTO
[2017/01/07 19:26:18.672996,  0] lib/fault.c:54(fault_report)
  
  From: http://www.samba.org/samba/docs/Samba3-HOWTO.pdf
[2017/01/07 19:26:18.673086,  0] lib/fault.c:55(fault_report)
  ===============================================================
[2017/01/07 19:26:18.673150,  0] lib/util.c:1117(smb_panic)
  PANIC (pid 2171): internal error
[2017/01/07 19:26:18.678661,  0] lib/util.c:1221(log_stack_trace)
  BACKTRACE: 15 stack frames:
   #0 0x1409188 <log_stack_trace+0x28> at /usr/local/sbin/smbd
   #1 0x1408a92 <smb_panic+0x52> at /usr/local/sbin/smbd
   #2 0x80321bc47 <talloc_set_memlimit+0xdd7> at /usr/local/lib/libtalloc.so.2
   #3 0x80321b783 <talloc_set_memlimit+0x913> at /usr/local/lib/libtalloc.so.2
   #4 0x80321b783 <talloc_set_memlimit+0x913> at /usr/local/lib/libtalloc.so.2
   #5 0x1418451 <server_event_context_free+0x21> at /usr/local/sbin/smbd
   #6 0x16355ed <exit_server+0x14d> at /usr/local/sbin/smbd
   #7 0x1635741 <exit_server_cleanly+0x11> at /usr/local/sbin/smbd
   #8 0x1634700 <main+0x1730> at /usr/local/sbin/smbd
   #9 0x80342992e <tevent_common_check_signal+0xee> at /usr/local/lib/libtevent.so.0
   #10 0x1417b9b <run_events_poll+0x2b> at /usr/local/sbin/smbd
   #11 0x14182e4 <s3_tevent_context_init+0x164> at /usr/local/sbin/smbd
   #12 0x803424fe8 <_tevent_loop_once+0x78> at /usr/local/lib/libtevent.so.0
   #13 0x16340e7 <main+0x1117> at /usr/local/sbin/smbd
   #14 0x1128b11 <_start+0x1b1> at /usr/local/sbin/smbd
[2017/01/07 19:26:18.680380,  0] lib/fault.c:416(dump_core)
  dumping core in /var/log/samba/cores/smbd
[2017/01/07 19:26:18.689473,  0] lib/util.c:1221(log_stack_trace)
  BACKTRACE: 5 stack frames:
   #0 0x1409188 <log_stack_trace+0x28> at /usr/local/sbin/smbd
   #1 0x1408a92 <smb_panic+0x52> at /usr/local/sbin/smbd
   #2 0x13f94d0 <fault_setup+0x190> at /usr/local/sbin/smbd
   #3 0x802ded78f <pthread_sigmask+0x4ff> at /lib/libthr.so.3
   #4 0x802decd6f <pthread_getspecific+0xe9f> at /lib/libthr.so.3
[2017/01/07 19:26:18.689815,  0] lib/fault.c:416(dump_core)
  dumping core in /var/log/samba/cores/smbd

Reverting to talloc-2.1.6, tevent-0.9.28, and tdb-1.3.12,1 solved the issue.
Comment 1 martin 2017-01-10 11:17:52 UTC
I am seeing similar problems with nmbd in samba42:

$ /usr/local/sbin/nmbd -S -F -d 255 --configfile=/usr/local/etc/smb4.conf
...
announce_myself_to_domain_master_browser: no unicast subnet, ignoring.
dump_workgroups()
 dump workgroup on subnet     192.168.1.1: netmask=  255.255.255.0:
	LISPWORKS(1) current master browser = UNKNOWN
		LWFS1-CAM 40819a03 (Samba 4.2.14)
find_name_on_subnet: on subnet REMOTE_BROADCAST_SUBNET - name LISPWORKS<1d> NOT FOUND
find_name_on_subnet: on subnet 192.168.1.1 - name LISPWORKS<1d> NOT FOUND
initiate_name_query_packet: sending query for name LISPWORKS<1d> (bcast=Yes) to IP 192.168.1.255
Sending a packet of len 50 to (192.168.1.255) on port 137
add_response_record: adding response record id:27778 to subnet 192.168.1.1. num_records:6
===============================================================
INTERNAL ERROR: Signal 11 in pid 14330 (4.2.14)
Please read the Trouble-Shooting section of the Samba HOWTO
===============================================================
PANIC (pid 14330): internal error
BACKTRACE: 7 stack frames:
 #0 0x8022dcc61 <log_stack_trace+0x21> at /usr/local/lib/libsmbconf.so.0
 #1 0x8022dca48 <smb_panic_s3+0x98> at /usr/local/lib/libsmbconf.so.0
 #2 0x8018de3b5 <smb_panic+0x35> at /usr/local/lib/libsamba-util.so.0
 #3 0x8018de99a <smb_panic+0x61a> at /usr/local/lib/libsamba-util.so.0
 #4 0x8018de373 <fault_setup+0x73> at /usr/local/lib/libsamba-util.so.0
 #5 0x80149bb4a <pthread_sigmask+0x51a> at /lib/libthr.so.3
 #6 0x80149b22c <pthread_getspecific+0xe1c> at /lib/libthr.so.3
unable to change to %N.core
refusing to dump core

Downgrading to talloc-2.1.6, tevent-0.9.28, and tdb-1.3.12,1 also seems to fix it.
Comment 2 Alexander Moisseev 2017-01-11 07:17:46 UTC
Upgrade of devel/tevent to 0.9.31 breaks samba-libsmbclient (and ports that depend on it) as well.
Downgrading to tevent-0.9.28 fixes it.
Comment 3 Marek Zarychta 2017-02-19 18:46:10 UTC
*** Bug 216528 has been marked as a duplicate of this bug. ***
Comment 4 Dwayne MacKinnon 2017-02-22 21:22:59 UTC
See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216230
Comment 5 Timur I. Bakeyev freebsd_committer 2017-02-23 02:02:28 UTC
(In reply to Alexander Moisseev from comment #2)

Well, it's getting awkward now. s samba3* been deprecated for few years now, the best solution would be to utilize libsmbclient from samba4. Unfortunately, it doesn't look as clean and tidy as the one from samba3:

./libsmbclient.so:
        libthr.so.3 => /lib/libthr.so.3 (0x801634000)
        libtevent-util.so.0 => /usr/local/lib/samba4/libtevent-util.so.0 (0x801858000)
        libsamba-errors.so.1 => /usr/local/lib/samba4/libsamba-errors.so.1 (0x801a5b000)
        liblibcli-lsa3-samba4.so => not found (0)
        libsamba-security-samba4.so => not found (0)
        libsamba3-util-samba4.so => not found (0)
        libsamba-util.so.0 => /usr/local/lib/samba4/libsamba-util.so.0 (0x801d97000)
        liblibsmb-samba4.so => not found (0)
        libmsrpc3-samba4.so => not found (0)
        libsmbconf.so.0 => /usr/local/lib/samba4/libsmbconf.so.0 (0x80201d000)
        libndr.so.0 => /usr/local/lib/samba4/libndr.so.0 (0x8022aa000)
        libsamba-debug-samba4.so => not found (0)
        libdcerpc-samba-samba4.so => not found (0)
        libcli-smb-common-samba4.so => not found (0)
        libgse-samba4.so => not found (0)
        libutil-cmdline-samba4.so => not found (0)
        libndr-standard.so.0 => /usr/local/lib/samba4/libndr-standard.so.0 (0x802600000)
        libsmbregistry-samba4.so => not found (0)
        libsecrets3-samba4.so => not found (0)
        libtalloc.so.2 => /usr/local/lib/libtalloc.so.2 (0x802e04000)
        libtevent.so.0 => /usr/local/lib/libtevent.so.0 (0x803012000)
        libc.so.7 => /lib/libc.so.7 (0x800822000)
        libtime-basic-samba4.so => /usr/local/lib/samba4/private/libtime-basic-samba4.so (0x803222000)
        libsamba-debug-samba4.so => /usr/local/lib/samba4/private/libsamba-debug-samba4.so (0x803424000)
        libgenrand-samba4.so => /usr/local/lib/samba4/private/libgenrand-samba4.so (0x80362b000)
        libreplace-samba4.so => /usr/local/lib/samba4/private/libreplace-samba4.so (0x80382d000)
        libsocket-blocking-samba4.so => /usr/local/lib/samba4/private/libsocket-blocking-samba4.so (0x803a35000)
        libmd.so.6 => /lib/libmd.so.6 (0x803c37000)
        libsmbregistry-samba4.so => /usr/local/lib/samba4/private/libsmbregistry-samba4.so (0x803e47000)
        libmessages-util-samba4.so => /usr/local/lib/samba4/private/libmessages-util-samba4.so (0x80406d000)
        libtalloc-report-samba4.so => /usr/local/lib/samba4/private/libtalloc-report-samba4.so (0x80426f000)
        libmessages-dgm-samba4.so => /usr/local/lib/samba4/private/libmessages-dgm-samba4.so (0x804472000)
        libserver-id-db-samba4.so => /usr/local/lib/samba4/private/libserver-id-db-samba4.so (0x80467f000)
        libdbwrap-samba4.so => /usr/local/lib/samba4/private/libdbwrap-samba4.so (0x804884000)
        libCHARSET3-samba4.so => /usr/local/lib/samba4/private/libCHARSET3-samba4.so (0x804a92000)
        libutil-tdb-samba4.so => /usr/local/lib/samba4/private/libutil-tdb-samba4.so (0x804c96000)
        libcli-smb-common-samba4.so => /usr/local/lib/samba4/private/libcli-smb-common-samba4.so (0x804e9a000)
        libsamba-cluster-support-samba4.so => /usr/local/lib/samba4/private/libsamba-cluster-support-samba4.so (0x8050db000)
        libsys-rw-samba4.so => /usr/local/lib/samba4/private/libsys-rw-samba4.so (0x8052de000)
        libutil-reg-samba4.so => /usr/local/lib/samba4/private/libutil-reg-samba4.so (0x8054e1000)
        libsamba3-util-samba4.so => /usr/local/lib/samba4/private/libsamba3-util-samba4.so (0x8056e4000)
        libsamba-sockets-samba4.so => /usr/local/lib/samba4/private/libsamba-sockets-samba4.so (0x8058f0000)
        libsamba-security-samba4.so => /usr/local/lib/samba4/private/libsamba-security-samba4.so (0x805b0d000)
        libinterfaces-samba4.so => /usr/local/lib/samba4/private/libinterfaces-samba4.so (0x805d35000)
        libsmbd-shim-samba4.so => /usr/local/lib/samba4/private/libsmbd-shim-samba4.so (0x805f38000)
        libutil-setid-samba4.so => /usr/local/lib/samba4/private/libutil-setid-samba4.so (0x80613b000)
        libtdb-wrap-samba4.so => /usr/local/lib/samba4/private/libtdb-wrap-samba4.so (0x80633e000)
        libsamba-hostconfig.so.0 => /usr/local/lib/samba4/libsamba-hostconfig.so.0 (0x806541000)
        libsmb-transport-samba4.so => /usr/local/lib/samba4/private/libsmb-transport-samba4.so (0x806777000)
        libserver-role-samba4.so => /usr/local/lib/samba4/private/libserver-role-samba4.so (0x80697d000)
        libexecinfo.so.1 => /usr/local/lib/libexecinfo.so.1 (0x806b7f000)
        libtdb.so.1 => /usr/local/lib/libtdb.so.1 (0x806d8e000)
        libldap-2.4.so.2 => /usr/local/lib/libldap-2.4.so.2 (0x806fa3000)
        liblber-2.4.so.2 => /usr/local/lib/liblber-2.4.so.2 (0x8071e9000)
        librt.so.1 => /usr/lib/librt.so.1 (0x8073f7000)
        libcrypt.so.5 => /lib/libcrypt.so.5 (0x8075fd000)
        libiov-buf-samba4.so => /usr/local/lib/samba4/private/libiov-buf-samba4.so (0x80781d000)
        libmsghdr-samba4.so => /usr/local/lib/samba4/private/libmsghdr-samba4.so (0x807a1f000)
        libgensec-samba4.so => /usr/local/lib/samba4/private/libgensec-samba4.so (0x807c22000)
        libndr-nbt.so.0 => /usr/local/lib/samba4/libndr-nbt.so.0 (0x807e59000)
        libm.so.5 => /lib/libm.so.5 (0x808083000)
        libfetch.so.6 => /usr/lib/libfetch.so.6 (0x8082ac000)
        libcom_err.so.5 => /usr/lib/libcom_err.so.5 (0x8084bf000)
        libssl.so.7 => /usr/lib/libssl.so.7 (0x8086c1000)
        libcrypto.so.7 => /lib/libcrypto.so.7 (0x80892d000)
        libwbclient.so.0 => /usr/local/lib/samba4/libwbclient.so.0 (0x808d22000)
        libcom_err-samba4.so.0 => /usr/local/lib/samba4/private/libcom_err-samba4.so.0 (0x808f37000)
        libsamba-modules-samba4.so => /usr/local/lib/samba4/private/libsamba-modules-samba4.so (0x809139000)
        libgssapi-samba4.so.2 => /usr/local/lib/samba4/private/libgssapi-samba4.so.2 (0x80933d000)
        libauthkrb5-samba4.so => /usr/local/lib/samba4/private/libauthkrb5-samba4.so (0x809589000)
        libndr-samba-samba4.so => /usr/local/lib/samba4/private/libndr-samba-samba4.so (0x809800000)
        libasn1util-samba4.so => /usr/local/lib/samba4/private/libasn1util-samba4.so (0x809c52000)
        libsamdb.so.0 => /usr/local/lib/samba4/libsamdb.so.0 (0x809e59000)
        libsamba-credentials.so.0 => /usr/local/lib/samba4/libsamba-credentials.so.0 (0x80a078000)
        libcliauth-samba4.so => /usr/local/lib/samba4/private/libcliauth-samba4.so (0x80a28e000)
        libwinbind-client-samba4.so => /usr/local/lib/samba4/private/libwinbind-client-samba4.so (0x80a4a8000)
        libkrb5-samba4.so.26 => /usr/local/lib/samba4/private/libkrb5-samba4.so.26 (0x80a6ac000)
        libroken-samba4.so.19 => /usr/local/lib/samba4/private/libroken-samba4.so.19 (0x80a93b000)
        libasn1-samba4.so.8 => /usr/local/lib/samba4/private/libasn1-samba4.so.8 (0x80ab4d000)
        libhcrypto-samba4.so.5 => /usr/local/lib/samba4/private/libhcrypto-samba4.so.5 (0x80ae14000)
        libheimbase-samba4.so.1 => /usr/local/lib/samba4/private/libheimbase-samba4.so.1 (0x80b064000)
        libauth-sam-reply-samba4.so => /usr/local/lib/samba4/private/libauth-sam-reply-samba4.so (0x80b269000)
        libkrb5samba-samba4.so => /usr/local/lib/samba4/private/libkrb5samba-samba4.so (0x80b46f000)
        libndr-krb5pac.so.0 => /usr/local/lib/samba4/libndr-krb5pac.so.0 (0x80b67c000)
        libgnutls.so.30 => /usr/local/lib/libgnutls.so.30 (0x80b88b000)
        libz.so.6 => /lib/libz.so.6 (0x80bbc4000)
        libsamdb-common-samba4.so => /usr/local/lib/samba4/private/libsamdb-common-samba4.so (0x80bdda000)
        libcli-ldap-common-samba4.so => /usr/local/lib/samba4/private/libcli-ldap-common-samba4.so (0x80c00e000)
        libldbsamba-samba4.so => /usr/local/lib/samba4/private/libldbsamba-samba4.so (0x80c218000)
        libldb.so.1 => /usr/local/lib/libldb.so.1 (0x80c44f000)
        libhx509-samba4.so.5 => /usr/local/lib/samba4/private/libhx509-samba4.so.5 (0x80c67f000)
        libwind-samba4.so.0 => /usr/local/lib/samba4/private/libwind-samba4.so.0 (0x80c8e4000)
        libp11-kit.so.0 => /usr/local/lib/libp11-kit.so.0 (0x80cb0d000)
        libidn.so.11 => /usr/local/lib/libidn.so.11 (0x80cd69000)
        libtasn1.so.6 => /usr/local/lib/libtasn1.so.6 (0x80cf9c000)
        libnettle.so.6 => /usr/local/lib/libnettle.so.6 (0x80d1ae000)
        libhogweed.so.4 => /usr/local/lib/libhogweed.so.4 (0x80d3e5000)
        libgmp.so.10 => /usr/local/lib/libgmp.so.10 (0x80d618000)
        libintl.so.8 => /usr/local/lib/libintl.so.8 (0x80d88e000)
        libflag-mapping-samba4.so => /usr/local/lib/samba4/private/libflag-mapping-samba4.so (0x80da99000)
        libffi.so.6 => /usr/local/lib/libffi.so.6 (0x80dc9c000)


I'm pretty sure most of those libraries are not necessary, but clean them up is a difficult process.
Comment 6 Timur I. Bakeyev freebsd_committer 2017-02-23 02:05:04 UTC
(In reply to Timur I. Bakeyev from comment #5)

On other side, for samba3:

./libsmbclient.so:
        libc.so.7 => /lib/libc.so.7 (0x800822000)
        libtalloc.so.2 => /usr/local/lib/libtalloc.so.2 (0x801b17000)
        libtevent.so.0 => /usr/local/lib/libtevent.so.0 (0x801d25000)
        libtdb.so.1 => /usr/local/lib/libtdb.so.1 (0x801f35000)
        libexecinfo.so.1 => /usr/lib/libexecinfo.so.1 (0x80214a000)
        libmd.so.6 => /lib/libmd.so.6 (0x80234d000)
        libz.so.6 => /lib/libz.so.6 (0x80255d000)
        libthr.so.3 => /lib/libthr.so.3 (0x802773000)
        librt.so.1 => /usr/lib/librt.so.1 (0x802997000)
        libcrypt.so.5 => /lib/libcrypt.so.5 (0x802b9d000)
        libelf.so.1 => /usr/lib/libelf.so.1 (0x802dbd000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x802fd2000)


So, I see the best ad-hoc solution would be to take samba36 code, enable built-in talloc and friends and compile library directly from the samba36 source, breaking master-slave linkage, as samba36 has open CVE and is deprecated.

Well, going to implement that.
Comment 7 Matthias Petermann 2017-03-01 18:29:37 UTC
Hi, there is another bug related to this:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216230
Comment 8 Matthias Petermann 2017-03-01 18:34:46 UTC
(In reply to Timur I. Bakeyev from comment #6)
(In reply to Matthias Petermann from comment #7)

So I fear fixing this issue locally in Samba 36 does not resolve the general issue brought by the upgrade of tevent to 0.9.31.