Hmm

ianm-openbsd:samba {134} time rcctl start samba

smbd(ok)

nmbd(ok)

25.730u 0.140s 0:25.89 99.9%    0+0k 0+56io 4pf+0w

That doesn't feel to me as bad as when the --as-needed was removed.

This is on a system built from sources fetched roughly 14th Feb 9:30am AEDT.


OpenBSD 6.4-current (GENERIC.MP) #1: Thu Feb 14 13:08:24 AEDT 2019

    
i...@ianm-openbsd.uws-libsystems.edu.au:/usr/src/sys/arch/amd64/compile/GENERIC.MP

real mem = 3141402624 (2995MB)

avail mem = 3036569600 (2895MB)

mpath0 at root

scsibus0 at mpath0: 256 targets

mainbus0 at root

bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe0010 (248 entries)

bios0: vendor Phoenix Technologies LTD version "6.00" date 04/13/2018

bios0: VMware, Inc. VMware Virtual Platform



Ian McWilliam

________________________________
From: owner-po...@openbsd.org <owner-po...@openbsd.org> on behalf of Ian 
McWilliam <i.mcwill...@westernsydney.edu.au>
Sent: Thursday, 14 February 2019 10:54 AM
To: Stuart Henderson; Mark Willson
Cc: ports@openbsd.org
Subject: Re: [ld.so] Re: smbd slow to start on -current

The bloated wart hog of windows networking rears its ugly head again....

Linker experts needed. These are things that may or may not happen depending on
whether or not we are OpenBSD.

buildtools/waf/samba/samba_autoconf.py

def SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS(conf):
    # we don't want any libraries or modules to rely on runtime
    # resolution of symbols
    if not sys.platform.startswith("openbsd"):
        conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', 
testflags=True)

    if not sys.platform.startswith("openbsd") and 
conf.env.undefined_ignore_ldflags == []:
        if conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup']):
            conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']

----

source3/wscript

    if sys.platform != 'openbsd5':
        conf.ADD_LDFLAGS("-Wl,--export-dynamic", testflags=True)

---
lib/ldb/wscript

        # we don't want any libraries or modules to rely on runtime
        # resolution of symbols
        if not sys.platform.startswith("openbsd"):
            conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)




Ian McWilliam

________________________________
From: owner-po...@openbsd.org <owner-po...@openbsd.org> on behalf of Stuart 
Henderson <s...@spacehopper.org>
Sent: Thursday, 14 February 2019 4:36 AM
To: Mark Willson
Cc: ports@openbsd.org
Subject: [ld.so] Re: smbd slow to start on -current

In gmane.os.openbsd.misc, you wrote:

Moving from misc@ to ports@ where it will be more visible.

> Folks,
>
> I'm running -current from 2019-02-11 (dmesg below) and seeing
> very slow start up with samba's smbd (4.8.7 version from ports).
>
> It appears to be a recurrence of the issue described here:
>
> https://groups.google.com/forum/#!topic/fa.openbsd.tech/yFTn1lyOQQI
>
> and here
>
> https://bugzilla.samba.org/show_bug.cgi?id=11355

Not sure what is going on and the effect does seem similar to the earlier
case from before -as-needed was used, but looking at build logs, smbd *is* built
with -as-needed:

19:10:58 runner cc default/source3/rpc_server/fssd_34.o 
default/source3/rpc_server/epmd_32.o default/source3/rpc_server/lsasd_33.o 
default/source3/smbd/server_142.o default/source3/smbd/smbd_cleanupd_142.o -o 
/usr/obj/ports/samba-4.8.7/samba-4.8.7/bin/default/source3/smbd/smbd 
-Wl,-z,relro,-z,now -lpthread -Wl,-no-undefined -Wl,--as-needed -lc 
-fstack-protector -Wl,-rpath,/usr/local/lib -Ldefault/source4/lib/socket 
-Ldefault/source4/lib/http -Ldefault/source4/libcli -Ldefault/libcli/nbt 
-Ldefault/source4/cluster -Ldefault/source4/libcli/ldap -Ldefault/source4/auth 
-Ldefault/source4/libcli/wbclient -Ldefault/nsswitch 
-Ldefault/source4/lib/events -Ldefault/libcli/registry 
-Ldefault/source4/lib/messaging -Ldefault/lib/tdb_wrap -Ldefault/source4/librpc 
-Ldefault/libcli/smb -Ldefault/libcli/cldap -Ldefault/lib/addns 
-Ldefault/auth/gensec -Ldefault/source4/auth/ntlm -Ldefault/libds/common 
-Ldefault/nsswitch/libwbclient -Ldefault/auth/credentials 
-Ldefault/lib/ldb-samba -Ldefault/so
 urce4/au
 th/kerberos -Ldefault/libcli/ldap -Ldefault/lib/ldb -Ldefault/lib/param 
-Ldefault/lib -Ldefault/lib/krb5_wrap -Ldefault/auth -Ldefault/lib/dbwrap 
-Ldefault/source3/auth -Ldefault/lib/socket -Ldefault/libcli/security 
-Ldefault/libcli/named_pipe_auth -Ldefault/source4/dsdb -Ldefault/libcli/auth 
-Ldefault/libcli/util -Ldefault/librpc -Ldefault/source4/heimdal_build 
-Ldefault/dfs_server -Ldefault/lib/tevent -Ldefault/lib/replace 
-Ldefault/lib/util -Ldefault/source3 -L/usr/local/lib -Wl,-Bdynamic 
-lpopt-samba3-samba4 -lsamba-util -lsmbd-base-samba4 -lutil-cmdline-samba4 
-ltime-basic-samba4 -lutil-setid -lsamba-debug-samba4 -lgenrand-samba4 
-lreplace -lsocket-blocking-samba4 -ltevent -ltalloc-report-samba4 
-ldfs-server-ad-samba4 -lprinting-migrate-samba4 -lgssapi-samba4 -ltevent-util 
-lmessages-dgm-samba4 -lndr-samba-samba4 -lsamba-errors -lnet-keytab-samba4 
-lcliauth-samba4 -lCHARSET3-samba4 -lnetapi -lsamdb -lsys-rw-samba4 
-lsmbd-conn-samba4 -lsamba3-util-samba4 -lsamba-passdb -
 lutil-td
 b-samba4 -lnpa-tstream-samba4 -lsamba-security-samba4 -linterfaces-samba4 
-lmessages-util-samba4 -lauth-samba4 -llibsmb-samba4 -lmsrpc3-samba4 
-lserver-id-db-samba4 -ldbwrap-samba4 -liov-buf-samba4 -lcommon-auth-samba4 
-lsmbconf -lsamba-cluster-support-samba4 -lkrb5samba-samba4 
-ldcerpc-samba-samba4 -lndr-krb5pac -lsamba-sockets-samba4 -lndr 
-lsecrets3-samba4 -lcli-spoolss-samba4 -lkrb5-samba4 -lroken-samba4 
-lasn1-samba4 -lhcrypto-samba4 -lcom_err-samba4 -lwind-samba4 -lmsghdr-samba4 
-lndr-standard -lasn1util-samba4 -lndr-nbt -lads-samba4 -lsamba-hostconfig 
-llibcli-netlogon3-samba4 -lldb -lsamdb-common-samba4 -lcli-ldap-common-samba4 
-lauthkrb5-samba4 -lldbsamba-samba4 -lsamba-credentials -lwbclient 
-lflag-mapping-samba4 -lsmbldap -lsmbldaphelper-samba4 -lauth4-samba4 
-llibcli-lsa3-samba4 -lgensec-samba4 -laddns-samba4 -lcli-cldap-samba4 
-lcli-smb-common-samba4 -lgse-samba4 -ldcerpc-binding -lndr-samba4 
-ltdb-wrap-samba4 -lMESSAGING-SEND-samba4 -lsmbd-shim-samba4 -lutil-re
 g-samba4
  -levents-samba4 -lheimbase-samba4 -lhx509-samba4 -ltrusts-util-samba4 
-lserver-role-samba4 -lwinbind-client-samba4 -lsamba-modules-samba4 
-lMESSAGING-samba4 -lLIBWBCLIENT-OLD-samba4 -lauth-unix-token-samba4 -ldcerpc 
-ldcerpc-samba4 -lcli-ldap-samba4 -lsmb-transport-samba4 -lcluster-samba4 
-lcli-nbt-samba4 -lsmbclient-raw-samba4 -lhttp-samba4 -lnetif-samba4 
-lavahi-common -lcrypto -lavahi-client -lpam -liconv -ltdb -lutil -lintl -lz 
-ljansson -lgcrypt -lgnutls -llber -lldap -lcups -lexecinfo -lpopt -lfam 
-ltalloc

> The delay can be seen using this command:
> LD_DEBUG=1 smbd -D 2>&1 | ts %.s
>
> The key piece of output is here, showing a 55s delay after
> examining /usr/lib/libm.so.10.1:
>
><snip>
> 1550056982.254470 linking dep /usr/local/lib/libgmp.so.10.0 as child of
> /usr/local/lib/libhogweed.so.2.0
> 1550056982.254539 examining: '/usr/local/lib/libgmp.so.10.0'
> 1550056982.254609 examining: '/usr/local/lib/libsasl2.so.3.1'
> 1550056982.254678 examining: '/usr/lib/libssl.so.47.3'
> 1550056982.254747 loading: libcrypto.so.45.3 required by
> /usr/lib/libssl.so.47.3
> 1550056982.254816 linking dep /usr/lib/libcrypto.so.45.3 as child of
> /usr/lib/libssl.so.47.3
> 1550056982.254886 examining: '/usr/lib/libm.so.10.1'
> 1550057037.791375  flags /usr/libexec/ld.so = 0x0
> 1550057037.791565 obj /usr/libexec/ld.so has smbd as head
> 1550057037.791672 static tls size=0 align=8 offset=0
> 1550057037.791894 protect RELRO [0x3a05766e000,0x3a05766f000) in
> /usr/lib/libm.so.10.1
> 1550057037.793600 protect RELRO [0x3a04047b000,0x3a040480000) in
> /usr/lib/libssl.so.47.3
></snip>
>
> if I compile and link a program, that does nothing, with
> "_Wl,--as-needed" and the shared libs used by smbd, I see the same
> kind of delay on startup. Maybe the issue is with ld, but I'm not sure
> if I am using the --as-needed flag in the correct way.

FWIW if I do that, I see approx 16s delay with as-needed, but it
takes twice as long without.

> Thanks,
> -mark
>
> OpenBSD 6.4-current (GENERIC.MP) #706: Mon Feb 11 20:59:31 MST 2019
>     dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> real mem = 2129461248 (2030MB)
> avail mem = 2055290880 (1960MB)
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root
> bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe0010 (68 entries)
> bios0: vendor LENOVO version "7FET96WW (2.14 )" date 12/25/2006
> bios0: LENOVO 0674KSG
> acpi0 at bios0: rev 2
> acpi0: sleep states S0 S3 S4 S5
> acpi0: tables DSDT FACP SSDT ECDT TCPA APIC MCFG HPET SLIC BOOT SSDT SSDT
> SSDT SSDT
> acpi0: wakeup devices LID_(S3) SLPB(S3) EXP0(S4) EXP1(S4) EXP2(S4) EXP3(S4)
> PCI1(S4) USB0(S3) USB1(S3) USB3(S3) USB7(S3) HDEF(S4)
> acpitimer0 at acpi0: 3579545 Hz, 24 bits
> acpiec0 at acpi0
> acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz, 1995.35 MHz, 06-0f-06
> cpu0:
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG,LAHF,PERF,SENSOR,MELTDOWN
> cpu0: 4MB 64b/line 16-way L2 cache
> cpu0: smt 0, core 0, package 0
> mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
> cpu0: apic clock running at 166MHz
> cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2, IBE
> cpu1 at mainbus0: apid 1 (application processor)
> cpu1: Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz, 1995.01 MHz, 06-0f-06
> cpu1:
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG,LAHF,PERF,SENSOR,MELTDOWN
> cpu1: 4MB 64b/line 16-way L2 cache
> cpu1: smt 0, core 1, package 0
> ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 24 pins, remapped
> acpimcfg0 at acpi0
> acpimcfg0: addr 0xf0000000, bus 0-63
> acpihpet0 at acpi0: 14318179 Hz
> acpiprt0 at acpi0: bus 0 (PCI0)
> acpiprt1 at acpi0: bus 1 (AGP_)
> acpiprt2 at acpi0: bus 2 (EXP0)
> acpiprt3 at acpi0: bus 3 (EXP1)
> acpiprt4 at acpi0: bus 4 (EXP2)
> acpiprt5 at acpi0: bus 12 (EXP3)
> acpiprt6 at acpi0: bus 21 (PCI1)
> acpicpu0 at acpi0: !C3(250@17 mwait.3@0x20), !C2(500@1 mwait.1@0x10),
> C1(1000@1 mwait.1), PSS
> acpicpu1 at acpi0: !C3(250@17 mwait.3@0x20), !C2(500@1 mwait.1@0x10),
> C1(1000@1 mwait.1), PSS
> acpipwrres0 at acpi0: PUBS, resource for USB0, USB7
> acpitz0 at acpi0: critical temperature is 127 degC
> acpitz1 at acpi0: critical temperature is 99 degC
> acpibtn0 at acpi0: LID_
> acpibtn1 at acpi0: SLPB
> acpicmos0 at acpi0
> "IBM0071" at acpi0 not configured
> tpm0 at acpi0: TPM_ addr 0xfed40000/0x1000: Atmel 97SC3203 rev 0x5
> acpibat0 at acpi0: BAT0 model "92P1129" serial  1672 type LION oem
> "Panasonic"
> acpiac0 at acpi0: AC unit online
> acpithinkpad0 at acpi0
> acpipci0 at acpi0 PCI0: 0x00000000 0x00000011 0x00000001
> acpidock0 at acpi0: GDCK not docked (0)
> acpivideo0 at acpi0: VID_
> acpivout0 at acpivideo0: LCD0
> acpivideo1 at acpi0: VID_
> acpivout at acpivideo1 not configured
> cpu0: Enhanced SpeedStep 1995 MHz: speeds: 2000, 1667, 1333, 1000 MHz
> pci0 at mainbus0 bus 0
> pchb0 at pci0 dev 0 function 0 "Intel 82945GM Host" rev 0x03
> ppb0 at pci0 dev 1 function 0 "Intel 82945GM PCIE" rev 0x03: msi
> pci1 at ppb0 bus 1
> radeondrm0 at pci1 dev 0 function 0 "ATI FireGL V5200" rev 0x00
> drm0 at radeondrm0
> radeondrm0: msi
> azalia0 at pci0 dev 27 function 0 "Intel 82801GB HD Audio" rev 0x02: msi
> azalia0: codecs: Analog Devices AD1981HD, Conexant/0x2bfa, using Analog
> Devices AD1981HD
> audio0 at azalia0
> ppb1 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x02: msi
> pci2 at ppb1 bus 2
> bge0 at pci2 dev 0 function 0 "Broadcom BCM5752M" rev 0x02, BCM5752 A2
> (0x6002): msi, address 00:1b:24:0b:8a:27
> brgphy0 at bge0 phy 1: BCM5752 10/100/1000baseT PHY, rev. 0
> ppb2 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x02: msi
> pci3 at ppb2 bus 3
> wpi0 at pci3 dev 0 function 0 "Intel PRO/Wireless 3945ABG" rev 0x02: msi,
> MoW2, address 00:19:d2:b1:ef:f5
> ppb3 at pci0 dev 28 function 2 "Intel 82801GB PCIE" rev 0x02: msi
> pci4 at ppb3 bus 4
> ppb4 at pci0 dev 28 function 3 "Intel 82801GB PCIE" rev 0x02: msi
> pci5 at ppb4 bus 12
> uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x02: apic 1 int 16
> uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x02: apic 1 int 17
> uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x02: apic 1 int 18
> uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x02: apic 1 int 19
> ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x02: apic 1 int 19
> usb0 at ehci0: USB revision 2.0
> uhub0 at usb0 configuration 1 interface 0 "Intel EHCI root hub" rev
> 2.00/1.00 addr 1
> ppb5 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xe2
> pci6 at ppb5 bus 21
> cbb0 at pci6 dev 0 function 0 "TI PCIXX12 CardBus" rev 0x00: apic 1 int 16
> "TI PCIXX12 FireWire" rev 0x00 at pci6 dev 0 function 1 not configured
> "TI PCIXX12 Multimedia Card Reader" rev 0x00 at pci6 dev 0 function 2 not
> configured
> sdhc0 at pci6 dev 0 function 3 "TI PCIXX12 SD" rev 0x00: apic 1 int 16
> sdhc0: SDHC 1.0, 48 MHz base clock
> sdmmc0 at sdhc0: 4-bit, sd high-speed, mmc high-speed
> cardslot0 at cbb0 slot 0 flags 0
> cardbus0 at cardslot0: bus 22 device 0 cacheline 0x8, lattimer 0xb0
> pcmcia0 at cardslot0
> pcib0 at pci0 dev 31 function 0 "Intel 82801GBM LPC" rev 0x02
> pciide0 at pci0 dev 31 function 1 "Intel 82801GB IDE" rev 0x02: DMA,
> channel 0 configured to compatibility, channel 1 configured to compatibility
> atapiscsi0 at pciide0 channel 0 drive 0
> scsibus1 at atapiscsi0: 2 targets
> cd0 at scsibus1 targ 0 lun 0: <MATSHITA, DVD-RAM UJ-850, RB11> ATAPI
> 5/cdrom removable
> cd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
> pciide0: channel 1 ignored (disabled)
> ahci0 at pci0 dev 31 function 2 "Intel 82801GBM AHCI" rev 0x02: msi, AHCI
> 1.1
> ahci0: port 0: 1.5Gb/s
> scsibus2 at ahci0: 32 targets
> sd0 at scsibus2 targ 0 lun 0: <ATA, KINGSTON SV300S3, 603A> SCSI3 0/direct
> fixed naa.50026b775605cd58
> sd0: 228936MB, 512 bytes/sector, 468862128 sectors, thin
> ichiic0 at pci0 dev 31 function 3 "Intel 82801GB SMBus" rev 0x02: apic 1
> int 23
> iic0 at ichiic0
> usb1 at uhci0: USB revision 1.0
> uhub1 at usb1 configuration 1 interface 0 "Intel UHCI root hub" rev
> 1.00/1.00 addr 1
> usb2 at uhci1: USB revision 1.0
> uhub2 at usb2 configuration 1 interface 0 "Intel UHCI root hub" rev
> 1.00/1.00 addr 1
> usb3 at uhci2: USB revision 1.0
> uhub3 at usb3 configuration 1 interface 0 "Intel UHCI root hub" rev
> 1.00/1.00 addr 1
> usb4 at uhci3: USB revision 1.0
> uhub4 at usb4 configuration 1 interface 0 "Intel UHCI root hub" rev
> 1.00/1.00 addr 1
> isa0 at pcib0
> isadma0 at isa0
> pckbc0 at isa0 port 0x60/5 irq 1 irq 12
> pckbd0 at pckbc0 (kbd slot)
> wskbd0 at pckbd0: console keyboard
> pms0 at pckbc0 (aux slot)
> wsmouse0 at pms0 mux 0
> wsmouse1 at pms0 mux 0
> pms0: Synaptics touchpad, firmware 6.2, 0x81a0b1 0x300000
> pcppi0 at isa0 port 0x61
> spkr0 at pcppi0
> aps0 at isa0 port 0x1600/31
> ugen0 at uhub3 port 1 "Broadcom Corp BCM2045B" rev 2.00/1.00 addr 2
> ugen1 at uhub3 port 2 "STMicroelectronics Biometric Coprocessor" rev
> 1.00/0.01 addr 3
> vscsi0 at root
> scsibus3 at vscsi0: 256 targets
> softraid0 at root
> scsibus4 at softraid0: 256 targets
> root on sd0a (660795fa2a3e9604.a) swap on sd0b dump on sd0b
> initializing kernel modesetting (RV530 0x1002:0x71C4 0x17AA:0x202B).
> radeon_cp: Failed to load firmware "radeon/R520_cp.bin"
> error: [drm:pid0:r100_cp_init] *ERROR* Failed to load firmware!
> drm:pid0:r520_startup *ERROR* failed initializing CP (-2).
> drm:pid0:r520_init *ERROR* Disabling GPU acceleration
> Can't enable IRQ/MSI because no handler is installed
> Can't enable IRQ/MSI because no handler is installed
> radeondrm0: 1024x768, 32bpp
> wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd0
> wsdisplay0: screen 1-5 added (std, vt100 emulation)
>
>
> --
> Mark Willson
> cdr....@gmail.com
> http://www.hydrus.org.uk
>

Reply via email to