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

Bug 339104

Summary: net-analyzer/nagios-plugins-1.4.14-r2 check_ldap segfault with PIE
Product: Gentoo Linux Reporter: montjoie <corentin.labbe>
Component: Current packagesAssignee: Tobias Scherbaum (RETIRED) <dertobi123>
Status: RESOLVED UPSTREAM    
Severity: normal CC: netmon
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: gdb backtrace

Description montjoie 2010-09-29 13:02:23 UTC
When i do /usr/lib64/nagios/plugins/check_ldap -3 -H 10.0.0.1 -b dc=toto,dc=com
check_ldap it segfault
When i modify Makefile and add -fno-pie it runs without problem

Reproducible: Always

Steps to Reproduce:
1./usr/lib64/nagios/plugins/check_ldap -3 -H 10.0.0.1 -b dc=toto,dc=com
2.
3.

Actual Results:  
check_ldap segfault

Expected Results:  
checl_ldap run

I had this bug on two machine, one with openldap-2.4.19 and one with openldap-2.4.23

Portage 2.1.8.3 (selinux/2007.0/amd64/hardened, gcc-4.3.4, glibc-2.11.2-r0, 2.6.32-gentoo-r7 x86_64)
=================================================================
System uname: Linux-2.6.32-gentoo-r7-x86_64-QEMU_Virtual_CPU_version_0.9.1-with-gentoo-1.12.13
Timestamp of tree: Wed, 29 Sep 2010 09:00:01 +0000
app-shells/bash:     4.0_p37
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.3.4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -g -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -g -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages loadpolicy news parallel-fetch protect-owned sandbox selinux sesandbox sfperms splitdebug strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 apache2 audit berkdb cli cracklib crypt cxx dri hardened iconv modules mudflap ncurses nls pam pcre pic pppd readline reflection selinux session slang ssl 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" 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" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware voodoo" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

I have beginning to debug, and it segfault in ldaplib options.c function ldap_set_option.
It's the assert( LDAP_VALID( ld ) ); that segfault
the pointer ld->ld_valid seems invalid in this assert( LDAP_VALID( ld ) );
Comment 1 montjoie 2010-09-29 13:41:07 UTC
Created attachment 248964 [details]
gdb backtrace
Comment 2 montjoie 2011-04-18 12:53:46 UTC
Since the upgrade to net-nds/openldap-2.4.24, the problem disapear