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

Bug 364689

Summary: app-portage/gentoolkit: revdep-rebuild should not scan /usr/lib{,64}/debug
Product: Portage Development Reporter: Xake <kanelxake>
Component: Third-Party ToolsAssignee: Portage Tools Team <tools-portage>
Status: CONFIRMED ---    
Severity: normal CC: bug, j6yNRdsH5Fc3, whissi
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Xake 2011-04-24 15:30:52 UTC
Currently revdep-rebuild scans /usr/lib/debug for broken libraries.
However residing inside of /usr/lib/debug are *.debug files, which are identified as libraries, but does not work or act like libraries, resulting in revdep-rebuild trying to run ldd on them, which fails due to those files not being neither executable or real libraries.

So in the end, scanning /usr/lib/debug is just waste of IO and CPU and time.
Please mask that directory as default.

$ emerge --info
Portage 2.2.0_alpha30 (hardened/linux/amd64, gcc-4.5.2, libc-0-r0, 2.6.38-hardened-r1 x86_64)
=================================================================
System uname: Linux-2.6.38-hardened-r1-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-2.0.2
Timestamp of tree: Sun, 24 Apr 2011 11:00:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.4 [disabled]
app-shells/bash:     4.2_p8
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.7.1-r1, 3.1.3-r1
dev-util/ccache:     3.1.4
dev-util/cmake:      2.8.4-r1
sys-apps/baselayout: 2.0.2
sys-apps/openrc:     0.8.2
sys-apps/sandbox:    2.5
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.9.6-r3, 1.11.1-r1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.5.2, 4.6.0
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
sys-kernel/linux-headers: 2.6.38
virtual/os-headers:  0
Repositories: gentoo gamerlay-stable x11 xake-overlay Mine
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -ggdb -mtune=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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="-march=native -O2 -pipe -ggdb -mtune=native"
DISTDIR="/var/portage/distfiles"
FEATURES="assume-digests binpkg-logs buildpkg distlocks fixlafiles fixpackages metadata-transfer news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS=""
GENTOO_MIRRORS="ftp://ftp.sunet.se/pub/os/Linux/distributions/gentoo"
LANG="en_US.utf-8"
LC_ALL="en_US.utf-8"
LDFLAGS="-Wl,--as-needed -Wl,-O1 -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu"
LINGUAS="sv en"
MAKEOPTS="-j16 -l15"
PKGDIR="/var/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="/var/portage"
PORTDIR_OVERLAY="/var/overlays/layman/gamerlay /var/overlays/layman/x11 /var/overlays/layman/xake-overlay /var/overlays/mine"
SYNC="rsync://liten.csbnet.se/gentoo-portage"
USE="X a52 aac accessibility acl acpi alsa amd64 amr amrnb amrwb applet archive asyncns autoipd avahi bash-completion bluetooth branding btrfs bzip2 cairo caps ccache cdaudio cdda cdr cleartype cli clutter connection-sharing consolekit coverart cracklib crypt cups cxx dbus device-mapper devicekit devkit dhcpcd digitalradio djvu dri dts dvd dvdr dvi eds enca encode eselect evo exif fat fbcondecor ffmpeg fftw flac fluidsynth fontconfig fuse gdbm gdm gdu geoip gif gimp glib gmp gnome gnome-keyring gphoto2 gpm grammar graphite gsf gsm gstreamer gtk gtk3 gtkstyle gudev hardened hires-icons hpn ical iconv iconvacl icq icu id3tag idn ieee1394 iptc ipv6 jabber jack java6 jingle jpeg jpeg2k justify kate kvm lcms libffi libnotify libsamplerate lm_sensors logrotate lvm lzma mad maps math matroska md mdadm midi mms mmx mmxext mng moonlight mp2 mp3 mpeg mpfr mpi msn mtp mudflap multilib musepack musicbrainz natspec nautilus ncurses network-cron networkmanager nfs nls nntp nptl nptlonly ntfs ntp nut offensive ogg openal opencore-amr opengl openmp openntpd ots pam pango parted pcre pdf perl pidgin playlist png policykit pppd pulseaudio python qt3support quicktime quvi raw readline realtime rrdcgi rtmp samba schroedinger seed sensord session smp sms speex spell sse sse2 sse3 ssl ssse3 startup-notification subversion svg sysfs test tex theora thesaurus threads tiff totem truetype udev unicode upnp urandom usb userlocales v4l2 vaapi vhook videos vim-syntax vorbis webkit wmf x264 xattr xcb xcomposite xinerama xml xmp xmpp xorg xrandr xscreensaver xulrunner xv xvid xvmc zeroconf zlib" ALSA_CARDS="hda-intel" 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" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="lvm mdraid plymouth 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="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="sv en" NETBEANS_MODULES="cnd profiler dlight harness ide java websvccommon apisupport nb" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" 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" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Marcin Mirosław 2012-04-28 11:37:38 UTC
On hardened-kernel it also triggers many messages in dmesg:
[497448.474532] grsec: From 127.0.0.6: denied RWX mprotect of /usr/lib64/debug/lib32/libm-2.14.1.so.debug by /lib32/ld-2.14.1.so[ld-linux.so.2:5023] uid/euid:0/0 gid/egid:0/0, parent /usr/bin/ldd[ldd:5021] uid/euid:0/0 gid/egid:0/0
[497448.486960] grsec: From 127.0.0.6: denied RWX mprotect of /usr/lib64/debug/lib32/libmemusage.so.debug by /lib32/ld-2.14.1.so[ld-linux.so.2:5030] uid/euid:0/0 gid/egid:0/0, parent /usr/bin/ldd[ldd:5028] uid/euid:0/0 gid/egid:0/0
Comment 2 Brian Dolbec (RETIRED) gentoo-dev 2012-04-28 16:25:51 UTC
Ah, both of you did not mention the version of gentoolkit.  The latest version of ~ gentoolkit has the new python version of revdep-rebuild.  Can you test if that one also looks at debug files as libs?
Comment 3 Marcin Mirosław 2012-04-28 19:57:01 UTC
I meant last stable version:)
Now i tried 0.3.0.6 and still the same:
[sob kwi 28 21:45:25 2012] grsec: From 127.0.0.6: denied RWX mprotect of /usr/lib64/debug/usr/lib64/gconv/UNICODE.so.debug by /lib64/ld-2.14.1.so[ld-linux-x86-64:41918] uid/euid:0/0 gid/egid:0/0, parent /usr/bin/ldd[ldd:41915] uid/euid:0/0 gid/egid:0/0
Comment 4 SpanKY gentoo-dev 2016-12-06 03:54:03 UTC
*** Bug 601536 has been marked as a duplicate of this bug. ***
Comment 5 Dyweni 2018-10-18 01:24:15 UTC
Hi,

Using =app-portage/gentoolkit-0.4.2-r1 and revdep-rebuild.sh

This is still scanning these files, and now that I've upgraded to glibc-2.26, getting hundreds of segfaults in dmesg, similar to:  "ld-linux.so.2[54721]: segfault at 4 ip 00000000f7fab5b4 sp 00000000ffcc2cd0 error 4 in ld-2.26.so[f7fa0000+25000]"

In the past, I tried the python version, but it wasn't detecting properly and don't remember anymore the reasons why.

I prefer to stay with the .sh script.

Thanks
Dyweni
Comment 6 Zac Medico gentoo-dev 2018-10-18 06:53:52 UTC
(In reply to Dyweni from comment #5)
> Hi,
> 
> Using =app-portage/gentoolkit-0.4.2-r1 and revdep-rebuild.sh
> 
> This is still scanning these files, and now that I've upgraded to
> glibc-2.26, getting hundreds of segfaults in dmesg, similar to: 
> "ld-linux.so.2[54721]: segfault at 4 ip 00000000f7fab5b4 sp 00000000ffcc2cd0
> error 4 in ld-2.26.so[f7fa0000+25000]"

If you have glibc built with -g or -ggdb in CFLAGS then maybe you can get a backtrace from a core dump as described here:

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