Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 571040

Summary: net-fs/samba-4.2.7: 'net usershare info' produces a segmentation fault
Product: Gentoo Linux Reporter: Fabio Coatti <fabio.coatti>
Component: Current packagesAssignee: Gentoo's SAMBA Team <samba>
Status: RESOLVED OBSOLETE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Fabio Coatti 2016-01-06 09:50:56 UTC
Hi all,
I'm seeing a quite puzzling behaviour:

cova@calvin ~ $ net usershare info
net usershare: usershares are currently disabled
Errore di segmentazione (core dump creato)

(sorry for the italian, but it is simply a segfault, with core dump creation)

If I emerge again samba, same version, the same command works just fine. But, and this is the part that puzzles me, if I reboot the system the command "net usershare info" segfaults again.

core file is not so useful, as samba is not compiled with debug options, however I'm doing this right now. 
Meanwhile, someone has suggestion about this issue?

Thanks.



Reproducible: Always




Portage 2.2.26 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop/plasma/systemd, gcc-5.3.0, glibc-2.22-r1, 4.3.3-cova x86_64)
=================================================================
System uname: Linux-4.3.3-cova-x86_64-Intel-R-_Core-TM-_i5-3427U_CPU_@_1.80GHz-with-gentoo-2.2
KiB Mem:     8091788 total,   2296180 free
KiB Swap:    8386556 total,   8386556 free
Timestamp of repository gentoo: Wed, 06 Jan 2016 09:30:01 +0000
sh bash 4.3_p42-r1
ld ld di GNU (Gentoo 2.25.1 p1.1) 2.25.1
distcc[9029] (dcc_mkdir) ERROR: mkdir '/var/tmp/portage/.distcc//state' failed: No such file or directory [disabled]
app-shells/bash:          4.3_p42-r1::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.1::gentoo
dev-lang/python:          2.7.11-r2::gentoo, 3.3.5-r7::gentoo, 3.4.3-r7::gentoo, 3.5.1-r2::gentoo
dev-util/cmake:           3.4.1::gentoo
dev-util/pkgconfig:       0.29::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.19.1::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.12.6-r1::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r1::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo, 5.3.0::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

hacking-gentoo
    location: /var/lib/layman/hacking-gentoo
    sync-type: laymansync
    sync-uri: rsync://rsync.mad-hacking.net/hacking-gentoo-overlay/
    masters: gentoo hacking-gentoo
    priority: 50

kde
    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

local
    location: /usr/overlay
    masters: gentoo
    priority: 51

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=ivybridge -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -maes -mno-sha -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-pcommit -mno-mwaitx --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=ivybridge -fstack-protector-strong"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=ivybridge -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -maes -mno-sha -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-pcommit -mno-mwaitx --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=ivybridge -fstack-protector-strong"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="it_IT.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="3dnow 3dnowext 3dnowprefetch X \ a52 aac aalib acl acpi aim alsa amd64 apng ares asf ati audio audiofile avahi bash-completion berkdb bidi bl branding bri bzip2 cairo caps ccdda cdda cdr cjk cli cracklib crypt cups curl cxx dba dbus declarative device-mapper dga divx divx4linux dparanoia dri dts dv dvb dvd dvdr dvdread eap-sim edl egl emboss encode ethereal evdev exif expat faad fam fame fbcon ffmpeg fftw firefox flac force-cgi-redirect fortran ftp gallium garmin gd gdbm gif gimp glamor gles2 gmedia gmp gnutls gphoto2 gpm gps gsm gtk h264 h323 iconv icq icu idn ifp ilbc imagemagick imap innodb ipod iproute2 ipv6 ithreads jabber java javascript joystick jpeg kde kipi kontact kvm lastfm lcms ldap libcaca libnotify libvirtd live lm_sensors lua lvm lxc lzma lzo mad maildir matroska mbox mdnsresponder-compat mhash mime mjpeg mmap mmx mmxext mng modules mozdevelop mozilla mp3 mp4 mpeg msn mtp multilib mysql ncurses network networkmanager new-hpcups nfsv4 njb nls nptl nptlonly nsplugin offensive ofx ogg oggvorbis ogm openal openexr opengl openmp oscar pam pango parted pcap pcre pdf phonon php plasma plotutils png policykit ppds pulseaudio qemu qml qt3support qt4 qt5 readline real rtc ruby samba sasl sdl seccomp semantic-desktop semantic-destkop session sha512 sip slang slp smartcard sndfile snmp sox speex spell srt sse sse2 ssh ssl ssse3 startup-notification svg symlink systemd tcltk tcpd telepathy theora threads tiff tk tremor truetype udev udisks unicode upower usb utempter v4l v4l2 vaapi vcd vde vhosts video videos vim-syntax virt-network virtualbox vorbis wav webkit widgets wifi wimax wmf wmp wps wxwidgets wxwindows x264 xanim xattr xcb xcomposite xface xft xine xinerama xml xosd xpm xscreensaver xsl xulrunner xv xvid zeroconf zlib zpm" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" DRACUT_MODULES="btrfs crypt crypt-gpg crypt-loop lvm plymouth systemd" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="it en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby20 ruby21 ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="intel v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.4"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Agostino Sarubbo gentoo-dev 2016-01-06 11:29:22 UTC
(In reply to Fabio Coatti from comment #0)
> (sorry for the italian, but it is simply a segfault, with core dump creation)

You just need to do LC_ALL="C" $command


> core file is not so useful, as samba is not compiled with debug options,
> however I'm doing this right now. 
> Meanwhile, someone has suggestion about this issue?

After compiling with debug(ggdb), and features splitdebug, you can start it with gdb.
Did you try also to see if the problem persist with a simple set of cflags like only -O2 ?
Comment 2 Fabio Coatti 2016-01-06 17:48:03 UTC
(In reply to Agostino Sarubbo from comment #1)
> (In reply to Fabio Coatti from comment #0)
> > (sorry for the italian, but it is simply a segfault, with core dump creation)
> 
> You just need to do LC_ALL="C" $command

No luck: 

cova@calvin ~ $ LC_ALL="C" net usershare info
net usershare: usershares are currently disabled
Errore di segmentazione (core dump creato)

> 
> 
> > core file is not so useful, as samba is not compiled with debug options,
> > however I'm doing this right now. 
> > Meanwhile, someone has suggestion about this issue?
> 
> After compiling with debug(ggdb), and features splitdebug, you can start it
> with gdb.
> Did you try also to see if the problem persist with a simple set of cflags
> like only -O2 ?

compiled as follows:

CFLAGS="-ggdb -O2"
CXXFLAGS="${CFLAGS}"
FEATURES="splitdebug installsources"

Same as before: if launched immediately after emerging it, no SEGV. Reboot, same command segfaults.  
/me puzzled.

Core was generated by `net usershare info'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f85bc7a29da in ?? () from /lib64/libc.so.6
(gdb) bt
#0  0x00007f85bc7a29da in ?? () from /lib64/libc.so.6
#1  0x00007f85bae99f75 in tdb_wrap_open (mem_ctx=mem_ctx@entry=0x0, name=name@entry=0x0, hash_size=hash_size@entry=0, tdb_flags=tdb_flags@entry=6337, open_flags=open_flags@entry=0, mode=mode@entry=420) at ../lib/tdb_wrap/tdb_wrap.c:146
#2  0x00007f85c1418f80 in gencache_init () at ../source3/lib/gencache.c:118
#3  0x00007f85c14194e5 in gencache_init () at ../source3/lib/gencache.c:672
#4  gencache_stabilize () at ../source3/lib/gencache.c:631
#5  0x0000556a27c0eed0 in main (argc=<optimized out>, argv=0x7ffceecfdfd8) at ../source3/utils/net.c:965
Comment 3 Fabio Coatti 2016-01-06 20:42:22 UTC
After some debugging, this seems to happen if /var/lock/samba/ does not exist. This happens on my system because /var/lock is a symlink to /run/lock, that is mounted on tmpfs, thus deleted at every reboot.

Probably this should be taken care by in some init script (I'm using systemd), however I opened a bug upstream, to see if a segfault can be avoided and a more informative error printed.


upstream bug:

https://bugzilla.samba.org/show_bug.cgi?id=11663

Interesting, I have no samba running on my system and thus no init script obviously ok to use to create the missing path :)