# Lots of segmentation faults on __libc_res_nquery

## delan

Hi everyone,

I'm having an interesting problem with my main box (but not my netbook) running Gentoo, and I'm not sure what is the problem exactly. Recently, a lot of programs have been crashing intermittently, but frequently, including Firefox, which is quite annoying. In addition, `emerge' doesn't seem to be able to resolve domain names at all anymore either. I've used a bit of gdb on Firefox and almost always get a SIGSEGV on __libc_res_nquery() in libresolv.so.

I looked a bit further and noticed that libresolv.so comes from glibc (I have glibc-2.14 as far as I can remember). However, I don't remember updating or recompiling glibc in a long time.

What could be the problem?

----------

## Hu

What is the output of emerge --info ; eix -e sys-devel/gcc -o -e sys-libs/glibc?

----------

## delan

Heh, I had to fetch the eix source tarball on my netbook and scp it over, as name resolution just didn't work on emerge (even though emerge didn't crash).

```
Portage 2.2.0_alpha38_p1 (default/linux/amd64/10.0, gcc-4.5.2, glibc-2.14-r0, 3.0.0-rc1-next-20110601 x86_64)

=================================================================

System uname: Linux-3.0.0-rc1-next-20110601-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9650_@_3.00GHz-with-gentoo-2.0.2

Timestamp of tree: Tue, 07 Jun 2011 09:45:01 +0000

distcc 3.1 x86_64-pc-linux-gnu [disabled]

app-shells/bash:          4.2_p10

dev-lang/python:          2.7.1-r1, 3.2

dev-util/cmake:           2.8.4-r1

sys-apps/baselayout:      2.0.2

sys-apps/openrc:          9999

sys-apps/sandbox:         2.5

sys-devel/autoconf:       2.13, 2.68

sys-devel/automake:       1.4_p6-r1, 1.11.1-r1

sys-devel/binutils:       2.21.51.0.9

sys-devel/gcc:            4.5.2

sys-devel/gcc-config:     1.5-r1

sys-devel/libtool:        2.4-r1

sys-devel/make:           3.82

sys-kernel/linux-headers: 2.6.38 (virtual/os-headers)

sys-libs/glibc:           2.14

Repositories:

gentoo

    location: /usr/portage

    sync: rsync://rsync.au.gentoo.org/gentoo-portage

    priority: -1000

local

    location: /usr/local/portage

    masters: gentoo

    priority: 0

x11

    location: /var/lib/layman/x11

    masters: gentoo

    priority: 1

oss-overlay

    location: /var/lib/layman/oss-overlay

    masters: gentoo

    priority: 2

Installed sets: 

ABI="amd64"

ACCEPT_KEYWORDS="** amd64"

ACCEPT_LICENSE="*"

ACCEPT_PROPERTIES="*"

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"

ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol"

APACHE2_MODULES="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"

ARCH="amd64"

ASFLAGS_x86="--32"

AUTOCLEAN="yes"

CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words"

CAMERAS="ptp2"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=core2 -O2 -pipe"

CFLAGS_x86="-m32"

CHOST="x86_64-pc-linux-gnu"

CHOST_amd64="x86_64-pc-linux-gnu"

CHOST_x86="i686-pc-linux-gnu"

CLEAN_DELAY="5"

COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"

COLLISION_IGNORE="/lib/modules"

CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/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"

CVS_RSH="ssh"

CXXFLAGS="-march=core2 -O2 -pipe"

DCCC_PATH="/usr/lib64/distcc/bin"

DEFAULT_ABI="amd64"

DISTCC_LOG=""

DISTCC_VERBOSE=""

DISTDIR="/usr/portage/distfiles"

ELIBC="glibc"

EMERGE_WARNING_DELAY="10"

EPREFIX=""

EROOT="/"

FCFLAGS=""

FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"

FETCHCOMMAND="/usr/bin/wget -t 3 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""

FETCHCOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""

FETCHCOMMAND_SFTP="bash -c "x=\${2#sftp://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec sftp -P \${port} \"\${host}:/\${x#*/}\" \"\$1\"" sftp "${DISTDIR}/${FILE}" "${URI}""

FETCHCOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec rsync --rsh=\"ssh -p\${port}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}""

FFLAGS=""

GCC_SPECS=""

GDK_USE_XFT="1"

GENTOO_MIRRORS="http://mirror.aarnet.edu.au/pub/gentoo"

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 ubx"

GSETTINGS_BACKEND="gconf"

GUILE_LOAD_PATH="/usr/share/guile/1.8"

HG="/usr/bin/hg"

HOME="/root"

INFOPATH="/usr/share/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.21.51.0.9/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.2/info"

INPUT_DEVICES="keyboard mouse"

KERNEL="linux"

LANG="en_AU.UTF-8"

LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

LDFLAGS_x86="-m elf_i386"

LESS="-R -M --shift 5"

LESSOPEN="|lesspipe.sh %s"

LIBDIR_amd64="lib64"

LIBDIR_amd64_fbsd="lib64"

LIBDIR_ppc="lib32"

LIBDIR_ppc64="lib64"

LIBDIR_s390="lib32"

LIBDIR_s390x="lib64"

LIBDIR_sparc32="lib32"

LIBDIR_sparc64="lib64"

LIBDIR_x86="lib32"

LIBDIR_x86_fbsd="lib32"

LOGNAME="root"

LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:"

MAIL="/var/mail/root"

MAKEOPTS="-j16"

MANPATH="/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.21.51.0.9/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.2/man:/usr/lib64/php5.3/man/"

MULTILIB_ABIS="amd64 x86"

MULTILIB_STRICT_DENY="64-bit.*shared object"

MULTILIB_STRICT_DIRS="/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib"

MULTILIB_STRICT_EXEMPT="(perl5|gcc|gcc-lib|binutils|eclipse-3|debug|portage|udev)"

NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml"

NOCOLOR="true"

OPENGL_PROFILE="nvidia"

PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin"

PHP_TARGETS="php5-3"

PKGDIR="/usr/portage/packages"

PORTAGE_ARCHLIST="ppc sparc64-freebsd ppc-openbsd x86-openbsd ppc64 x86-winnt x86-fbsd ppc-aix alpha arm x86-freebsd s390 amd64 arm-linux x86-macos x64-openbsd ia64-hpux hppa x86-netbsd x86-cygwin amd64-linux ia64-linux x86 sparc-solaris x64-freebsd sparc64-solaris x86-linux x64-macos sparc m68k-mint ia64 mips ppc-macos x86-interix hppa-hpux amd64-fbsd x64-solaris mips-irix m68k sh x86-solaris sparc-fbsd"

PORTAGE_BINHOST_CHUNKSIZE="3000"

PORTAGE_BIN_PATH="/usr/lib64/portage/bin"

PORTAGE_COMPRESS_EXCLUDE_SUFFIXES="css gif htm[l]? jp[e]?g js pdf png"

PORTAGE_CONFIGROOT="/"

PORTAGE_DEBUG="0"

PORTAGE_DEPCACHEDIR="/var/cache/edb/dep"

PORTAGE_ELOG_CLASSES="log warn error"

PORTAGE_ELOG_MAILFROM="portage@localhost"

PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for ${PACKAGE} on ${HOST}"

PORTAGE_ELOG_MAILURI="root"

PORTAGE_ELOG_SYSTEM="save_summary echo"

PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5"

PORTAGE_FETCH_RESUME_MIN_SIZE="350K"

PORTAGE_GID="250"

PORTAGE_GPG_SIGNING_COMMAND="gpg --sign --clearsign --yes --default-key "${PORTAGE_GPG_KEY}" --homedir "${PORTAGE_GPG_DIR}" "${FILE}""

PORTAGE_INST_GID="0"

PORTAGE_INST_UID="0"

PORTAGE_PYM_PATH="/usr/lib64/portage/pym"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_RSYNC_RETRIES="-1"

PORTAGE_SANDBOX_COMPAT_LEVEL="22"

PORTAGE_SYNC_STALE="30"

PORTAGE_TMPDIR="/var/tmp"

PORTAGE_VERBOSE="1"

PORTAGE_WORKDIR_MODE="0700"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage /var/lib/layman/x11 /var/lib/layman/oss-overlay"

PRELINK_PATH_MASK="/usr/lib64/libfreebl3.so:/usr/lib64/libnssdbm3.so:/usr/lib64/libsoftokn3.so"

PROFILE_ONLY_VARIABLES="ARCH ELIBC KERNEL USERLAND"

PYTHONDONTWRITEBYTECODE="1"

RESUMECOMMAND="/usr/bin/wget -c -t 3 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""

RESUMECOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""

RESUMECOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec rsync --rsh=\"ssh -p\${port}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}""

ROOT="/"

ROOTPATH="/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.2"

RPMDIR="/usr/portage/rpm"

RUBY_TARGETS="ruby18"

SHELL="/bin/bash"

STAGE1_USE="multilib nptl nptlonly unicode"

SUDO_COMMAND="/usr/bin/emerge -av --info"

SUDO_GID="1000"

SUDO_UID="1000"

SUDO_USER="delan"

SYMLINK_LIB="yes"

SYNC="rsync://rsync.au.gentoo.org/gentoo-portage"

TERM="xterm"

USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm gpm iconv ipv6 jpeg mmx modules mudflap multilib ncurses nls nptl nptlonly openmp oss pam pcre perl pppd python readline session sse sse2 ssl sysfs tcpd unicode xorg zlib" 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" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" 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 ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nouveau" 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" 

USER="root"

USERLAND="GNU"

USERNAME="root"

USE_EXPAND="ALSA_CARDS ALSA_PCM_PLUGINS APACHE2_MODULES APACHE2_MPMS CALLIGRA_FEATURES CAMERAS COLLECTD_PLUGINS CROSSCOMPILE_OPTS DRACUT_MODULES DVB_CARDS ELIBC FCDSL_CARDS FOO2ZJS_DEVICES FRITZCAPI_CARDS GPSD_PROTOCOLS INPUT_DEVICES KERNEL LCD_DEVICES LINGUAS LIRC_DEVICES MISDN_CARDS NETBEANS_MODULES NGINX_MODULES_HTTP NGINX_MODULES_MAIL PHP_TARGETS QEMU_SOFTMMU_TARGETS QEMU_USER_TARGETS RUBY_TARGETS SANE_BACKENDS USERLAND VIDEO_CARDS XFCE_PLUGINS XTABLES_ADDONS"

USE_EXPAND_HIDDEN="CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND"

USE_ORDER="env:pkg:conf:defaults:pkginternal:env.d"

VBOX_APP_HOME="/opt/VirtualBox"

VIDEO_CARDS="nouveau"

XDG_CONFIG_DIRS="/etc/xdg"

XDG_DATA_DIRS="/usr/local/share:/usr/share"

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"

[I] sys-devel/gcc

     Available versions:  

   (2.95)   2.95.3-r9 2.95.3-r10!s

   (3.1)   3.1.1-r2

   (3.2)   3.2.2!s 3.2.3-r4

   (3.3)   3.3.6-r1!s

   (3.4)   3.4.6-r2!s

   (4.0)   4.0.4!s

   (4.1)   4.1.2!s

   (4.2)   4.2.4-r1!s

   (4.3)   4.3.3-r2!s 4.3.4!s 4.3.5!s

   (4.4)   4.4.2!s 4.4.3-r3!s 4.4.4-r2!s 4.4.5!s

   (4.5)   4.5.1-r1!s 4.5.2!s

   {altivec bootstrap boundschecking build d doc fixed-point fortran gcj graphite gtk hardened ip28 ip32r10k java libffi lto mudflap multilib multislot n32 n64 nls nocxx nopie nossp nptl objc objc++ objc-gc openmp static test vanilla}

     Installed versions:  4.5.2(4.5)!s(10:40:12 16/04/11)(fortran mudflap multilib nls nptl openmp -altivec -bootstrap -build -doc -fixed-point -gcj -graphite -gtk -hardened -libffi -lto -multislot -n32 -n64 -nocxx -nopie -nossp -objc -objc++ -objc-gc -test -vanilla)

     Homepage:            http://gcc.gnu.org/

     Description:         The GNU Compiler Collection

[D] sys-libs/glibc

     Available versions:  (2.2) [P]2.2.5-r10!s 2.5-r4!s 2.5.1!s 2.6.1!s 2.7-r2!s 2.8_p20080602-r1!s 2.9_p20081201-r2!s 2.9_p20081201-r3!s 2.10.1-r1!s 2.11.2-r3!s 2.11.3!s 2.12.1-r3!s 2.12.2!s 2.13-r1!s

   {build crosscompile_opts_headers-only debug gd glibc-compat20 glibc-omitfp hardened multilib nls nptl nptlonly profile selinux vanilla}

     Installed versions:  2.14(2.2)!s(16:44:27 02/06/11)(multilib nls -crosscompile_opts_headers-only -debug -gd -glibc-omitfp -hardened -profile -selinux -vanilla)

     Homepage:            http://www.gnu.org/software/libc/libc.html

     Description:         GNU libc6 (also called glibc2) C library

Found 2 matches.

```

----------

## delan

I realised that this is a glibc problem with 2.14.

I also just found this page where Arch users are having the same problem: https://bugs.archlinux.org/task/24615

I am now currently downgrading glibc to 2.13-r2 to see if that helps.

Should I report this as a bug somewhere?

----------

## Hu

Yes, please file a bug.

----------

