Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 587516 - sys-apps/systemd-230-r2: systemd-resolve segfaults upon domain name resolution
Summary: sys-apps/systemd-230-r2: systemd-resolve segfaults upon domain name resolution
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-29 14:13 UTC by Lara Maia
Modified: 2017-04-20 12:38 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lara Maia 2016-06-29 14:13:10 UTC
I'm using systemd-resolve as the default system dns resolver, but after the last update the process handling the resolving (/lib/systemd/systemd-resolved) will segfault upon domain name resolution.

For example:

$ ping google.com
[ 2161.249342] systemd-resolve[28016]: segfault at 5c ip 000055915823cdc3 sp 00007ffd8d6da3c0 error 4 in systemd-resolved[559158215000+ac000]
ping: unknown host google.com

$ wget google.com
--2016-06-29 11:02:01--  http://google.com/
Resolving google.com...[ 2209.601885] systemd-resolve[28183]: segfault at 5c ip 00005557108f2dc3 sp 00007fffc4b313f0 error 4 in systemd-resolved[5557108cb000+ac000]
 failed: Name or service not known.
wget: unable to resolve host address 'google.com'




Reproducible: Always

Steps to Reproduce:
1. replace dns with resolve in /etc/nsswitch.conf
2. Start the systemd-resolved.service
3. Run: ping google.com



emerge --info:

Portage 2.3.0 (python 3.4.4-final-0, default/linux/amd64/13.0/systemd, gcc-5.4.0, glibc-2.23-r2, 4.5.6-1-amora x86_64)
=================================================================
System uname: Linux-4.5.6-1-amora-x86_64-AMD_A8-6600K_APU_with_Radeon-tm-_HD_Graphics-with-gentoo-2.2
KiB Mem:     7162732 total,   5552132 free
KiB Swap:   14314492 total,  14314492 free
Timestamp of repository gentoo: Tue, 28 Jun 2016 12:42:23 +0000
Timestamp of repository ShyPixie: Mon, 27 Jun 2016 21:27:07 +0000
Timestamp of repository bobwya: Mon, 27 Jun 2016 08:19:41 +0000
Timestamp of repository games-overlay: Mon, 27 Jun 2016 08:19:46 +0000
Timestamp of repository sabayon-tools: Mon, 27 Jun 2016 08:20:24 +0000
Timestamp of repository steam-overlay: Mon, 27 Jun 2016 08:20:07 +0000
Timestamp of repository x11: Mon, 27 Jun 2016 08:20:12 +0000
sh bash 4.3_p46
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p46::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.11-r2::gentoo, 3.4.4::gentoo
dev-util/cmake:           3.5.2-r1::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.21::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            5.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.6::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: git://github.com/gentoo-mirror/gentoo.git
    priority: -1000

ShyPixie
    location: /var/lib/layman/ShyPixie
    masters: gentoo
    priority: 50

bobwya
    location: /var/lib/layman/bobwya
    masters: gentoo
    priority: 50

games-overlay
    location: /var/lib/layman/games-overlay
    masters: gentoo
    priority: 50

sabayon-tools
    location: /var/lib/layman/sabayon-tools
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    masters: gentoo
    priority: 50

x11
    location: /var/lib/layman/x11
    masters: gentoo
    priority: 50

Installed sets: @steam
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=bdver2 -mtune=bdver2 -O2 -pipe -fomit-frame-pointer -fstack-protector "
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=bdver2 -mtune=bdver2 -O2 -pipe -fomit-frame-pointer -fstack-protector "
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs candy cgroup clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news nodoc noinfo 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"
INSTALL_MASK="INSTALL.gz               TODO.gz               /etc/init.d               /etc/conf.d               /etc/runlevels"
LANG="pt_BR.utf8"
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_COMPRESS_FLAGS=""
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 --exclude=/.git"
PORTAGE_TMPDIR="/tmp"
USE="64bit X aac acl alsa amd64 berkdb branding bzip2 cairo caps cdr cli colord cracklib crypt cxx dbus dri dts egl exif fortran gdbm gif glamor gtk3 gudev highlight iconv icu introspection ipv6 jpeg lcms libnotify lzma mad magic math mmx mmxext modules mp3 mp4 mpeg multilib ncurses nls nptl ogg openal opengl openmp pam pango pcre pdf png policykit pulseaudio python rar readline sdl seccomp session sound sqlite sse sse2 ssl startup-notification svg systemd tcpd theora tiff truetype udev udisks unicode urandom usb vaapi vala vorbis x264 xattr xcb xcomposite xkb xml xvid zlib" 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 fma3 fma4 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop" 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" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="pt_BR" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python3_4 python2_7" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi radeon" XFCE_PLUGINS="trash power clock battery" 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"
Unset:  CC, CPPFLAGS, CTARGET, CXX, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Mike Gilbert gentoo-dev 2016-06-29 14:24:09 UTC
It seems to work fine for me.

floppym@naomi ~ % grep ^hosts: /etc/nsswitch.conf
hosts:       files resolve

floppym@naomi ~ % getent hosts www.google.com
2607:f8b0:400b:806::2004 www.google.com

A couple of suggestions:

1. Obtain a backtrace using gdb.

https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces

2. Test with systemd-9999 to see if the issue has been resolved upstream.
Comment 2 Lara Maia 2016-06-30 02:28:21 UTC
(In reply to Mike Gilbert from comment #1)
> It seems to work fine for me.
> 
> floppym@naomi ~ % grep ^hosts: /etc/nsswitch.conf
> hosts:       files resolve
> 
> floppym@naomi ~ % getent hosts www.google.com
> 2607:f8b0:400b:806::2004 www.google.com
> 
> A couple of suggestions:
> 
> 1. Obtain a backtrace using gdb.
> 
> https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
> 
> 2. Test with systemd-9999 to see if the issue has been resolved upstream.

Program received signal SIGSEGV, Segmentation fault.
dns_transaction_cache_answer (t=0x5555558244e0) at /tmp/portage/sys-apps/systemd-230-r2/work/systemd-230/src/resolve/resolved-dns-transaction.c:582
582     /tmp/portage/sys-apps/systemd-230-r2/work/systemd-230/src/resolve/resolved-dns-transaction.c: Arquivo ou diretório não encontrado.
(gdb) bt
#0  dns_transaction_cache_answer (t=0x5555558244e0) at /tmp/portage/sys-apps/systemd-230-r2/work/systemd-230/src/resolve/resolved-dns-transaction.c:582
#1  dns_transaction_process_dnssec (t=0x5555558244e0) at /tmp/portage/sys-apps/systemd-230-r2/work/systemd-230/src/resolve/resolved-dns-transaction.c:717
#2  0x000055555557c07d in dns_transaction_complete (t=t@entry=0x555555829840, state=state@entry=DNS_TRANSACTION_SUCCESS) at /tmp/portage/sys-apps/systemd-230-r2/work/systemd-230/src/resolve/resolved-dns-transaction.c:361
#3  0x000055555557bbdb in dns_transaction_process_dnssec (t=t@entry=0x555555829840) at /tmp/portage/sys-apps/systemd-230-r2/work/systemd-230/src/resolve/resolved-dns-transaction.c:720
#4  0x000055555557e0fc in dns_transaction_process_reply (t=t@entry=0x555555829840, p=0x55555582d300) at /tmp/portage/sys-apps/systemd-230-r2/work/systemd-230/src/resolve/resolved-dns-transaction.c:1002
#5  0x000055555557e843 in on_dns_packet (s=<optimized out>, fd=<optimized out>, revents=<optimized out>, userdata=0x555555829840) at /tmp/portage/sys-apps/systemd-230-r2/work/systemd-230/src/resolve/resolved-dns-transaction.c:1053
#6  0x00005555555c3dab in source_dispatch (s=s@entry=0x55555582a940) at /tmp/portage/sys-apps/systemd-230-r2/work/systemd-230/src/libsystemd/sd-event/sd-event.c:2268
#7  0x00005555555c4d04 in sd_event_dispatch (e=e@entry=0x5555558080a0) at /tmp/portage/sys-apps/systemd-230-r2/work/systemd-230/src/libsystemd/sd-event/sd-event.c:2629
#8  0x00005555555c4ecc in sd_event_run (e=e@entry=0x5555558080a0, timeout=timeout@entry=18446744073709551615) at /tmp/portage/sys-apps/systemd-230-r2/work/systemd-230/src/libsystemd/sd-event/sd-event.c:2688
#9  0x00005555555c509f in sd_event_loop (e=0x5555558080a0) at /tmp/portage/sys-apps/systemd-230-r2/work/systemd-230/src/libsystemd/sd-event/sd-event.c:2708
#10 0x000055555555d79d in main (argc=<optimized out>, argv=<optimized out>) at /tmp/portage/sys-apps/systemd-230-r2/work/systemd-230/src/resolve/resolved.c:98
Comment 3 Lara Maia 2016-06-30 03:14:32 UTC
Sorry, the issue has been resolved in systemd-9999
Comment 4 Reuben Martin 2016-07-12 01:52:57 UTC
I think this may be the fix:

https://github.com/systemd/systemd/pull/3553/commits/8e5546187b46773da7b9a7027b82913a1f9861f4


Would be nice to bundle that commit as a patch with the current ebuild. It fixes a lot of ugly segfaults in resolve.
Comment 5 Pacho Ramos gentoo-dev 2017-04-20 12:38:09 UTC
This should be solved in 233