Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 251421 - sys-libs/libselinux segfault on exit
Summary: sys-libs/libselinux segfault on exit
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal
Assignee: Chris PeBenito (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-18 08:11 UTC by Francesco Riosa
Modified: 2009-08-17 17:10 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 Francesco Riosa 2008-12-18 08:11:00 UTC
the package segfault freeing something, on this system it's exposed by
# python -c "import pygtk; pygtk.require('2.0'); import gtk"

the bug is reported from other utilizers, and better explained that I'm able to do here:

https://www.libavg.de/wiki/index.php/Known_Linux_Installation_Issues
->  Segfault on Termination ->  Workaround 2: DIY

See also
https://bugs.launchpad.net/ubuntu/+source/libselinux/+bug/237156
and a patch
http://launchpadlibrarian.net/15599819/libselinux1_patch

another BAD BAD workaround is 
DISABLE_SETRANS=y emerge -1 sys-libs/libselinux

follow gdb, valgrind (cutted) and emerge --info

good luck

gdb run:
gdb python
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu"...
(gdb) run -c "import pygtk; pygtk.require('2.0'); import gtk"
Starting program: /usr/bin/python -c "import pygtk; pygtk.require('2.0'); import gtk"

Program received signal SIGSEGV, Segmentation fault.
0x00007f425e09e000 in fini_context_translations () at setrans_client.c:217
217             free(prev_r2t_trans);
(gdb) bt
#0  0x00007f425e09e000 in fini_context_translations () at setrans_client.c:217
#1  0x00007f425e092652 in ?? () from /lib/libselinux.so.1
#2  0x0000000000000000 in ?? ()
(gdb) list
212             return ret;
213     }
214
215     hidden void fini_context_translations(void)
216     {
217             free(prev_r2t_trans);
218             free(prev_r2t_raw);
219             free(prev_t2r_trans);
220             free(prev_t2r_raw);
221     }
(gdb)


valgrind python -c "import pygtk; pygtk.require('2.0'); import gtk"
[...]
==31191==
==31191== Invalid read of size 8
==31191==    at 0xD9C1000: fini_context_translations (setrans_client.c:217)
==31191==    by 0xD9B5651: (within /lib64/libselinux.so.1)
==31191==    by 0xD9C2814: (within /lib64/libselinux.so.1)
==31191==    by 0x5A6066C: exit (in /lib64/libc-2.9.so)
==31191==    by 0x5A485BC: (below main) (in /lib64/libc-2.9.so)
==31191==  Address 0x78 is not stack'd, malloc'd or (recently) free'd
==31191==
==31191== Process terminating with default action of signal 11 (SIGSEGV)
==31191==  Access not within mapped region at address 0x78
==31191==    at 0xD9C1000: fini_context_translations (setrans_client.c:217)
==31191==    by 0xD9B5651: (within /lib64/libselinux.so.1)
==31191==    by 0xD9C2814: (within /lib64/libselinux.so.1)
==31191==    by 0x5A6066C: exit (in /lib64/libc-2.9.so)
==31191==    by 0x5A485BC: (below main) (in /lib64/libc-2.9.so)
==31191==
==31191== ERROR SUMMARY: 886 errors from 85 contexts (suppressed: 332 from 2)
==31191== malloc/free: in use at exit: 5,000,292 bytes in 6,604 blocks.
==31191== malloc/free: 19,092 allocs, 12,488 frees, 10,663,738 bytes allocated.
==31191== For counts of detected errors, rerun with: -v
==31191== searching for pointers to 6,604 not-freed blocks.
==31191== checked 5,395,720 bytes.
==31191==
==31191== LEAK SUMMARY:
==31191==    definitely lost: 0 bytes in 0 blocks.
==31191==      possibly lost: 36,432 bytes in 87 blocks.
==31191==    still reachable: 4,963,860 bytes in 6,517 blocks.
==31191==         suppressed: 0 bytes in 0 blocks.
==31191== Rerun with --leak-check=full to see details of leaked memory.
Segmentation fault


$ emerge --info
 * Overlay eclasses override eclasses from PORTDIR:
 *
 *   '/g/ovl/kde-crazy/eclass/kde4-base.eclass'
 *   '/g/ovl/kde-crazy/eclass/kde4-functions.eclass'
 *   '/g/ovl/kde-crazy/eclass/kde4-meta.eclass'
 *   '/g/ovl/kde-crazy/eclass/qt4-build.eclass'
 *
 * It is best to avoid overriding eclasses from PORTDIR because it will
 * trigger invalidation of cached ebuild metadata that is distributed with
 * the portage tree. If you must override eclasses from PORTDIR then you
 * are advised to add FEATURES="metadata-transfer" to /etc/make.conf and to
 * run `emerge --regen` after each time that you run `emerge --sync`. Set
 * PORTAGE_ECLASS_WARNING_ENABLE="0" in /etc/make.conf if you would like to
 * disable this warning.
Portage 2.2_rc17 (selinux/2007.0/amd64, gcc-4.3.2, glibc-2.9_p20081201-r0, 2.6.28-rc8 x86_64)
=================================================================
System uname: Linux-2.6.28-rc8-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9300_@_2.50GHz-with-glibc2.2.5
Timestamp of tree: Tue, 16 Dec 2008 02:19:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p48
dev-java/java-config: 1.3.7-r1, 2.1.6-r1
dev-lang/python:     2.5.2-r8
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.2
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.0
sys-apps/sandbox:    1.2.18.1-r3
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=nocona -pipe -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/4.2/env /usr/kde/4.2/share/config /usr/kde/4.2/shutdown /usr/kde/live/env /usr/kde/live/share/config /usr/kde/live/shutdown /usr/share/config /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/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=nocona -pipe -ggdb"
DISTDIR="/srv/distfiles"
FEATURES="distlocks fixpackages installsources loadpolicy metadata-transfer parallel-fetch protect-owned sandbox selinux sesandbox sfperms sign splitdebug strict unmerge-orphans userfetch userpriv"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://mirror.datapipe.net/gentoo ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://ftp.linux.ee/pub/gentoo/distfiles/ http://128.213.5.34/gentoo/ http://ftp.gentoo.skynet.be/pub/gentoo/ http://gentoo.tiscali.nl/gentoo/ http://gentoo.inode.at/"
LANG="it_IT.UTF-8"
LC_ALL="it_IT.UTF-8"
LDFLAGS="-Wl,--hash-style=both"
LINGUAS="it"
MAKEOPTS="-j4"
PKGDIR="/g/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
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="/g/tmp"
PORTDIR="/home/portage/portage"
PORTDIR_OVERLAY="/g/ovl/mysql /g/ovl/tmp /g/ovl/kde-crazy"
SYNC="rsync://sources.pnpitalia.it/gentoo-portage"
USE="3dnow X a52 aac alsa amd64 amr apache2 apm asf automount avahi avi bash-completion berkdb bitmap-fonts bluetooth browserplugin bzip2 cairo caps captury cdda cddb chm cjk cli compositor cracklib crypt cups curl dbus debug decibel dedicated device-mapper djvu dri dvdread emboss encode engines erandom exif exiv2 extrafilters fam fame ffmpeg firefox flac foomaticdb fortran gdbm geos gif glitz gpm gstreamer gtk2 hal hdf hdf5 hpn htmlhandbook iconv idn imagemagick imlib iproute2 ipv6 isdnlog ithreads jack java jingle jpeg jpeg2k justify kde kdeenablefinal kdehiddenvisibility kdepim kdeprefix kontact latex libg++ libwww lua lzo mad messenger midi mikmod mjpeg mmx mng motif mp3 mpeg mplayer mudflap multilib mysql ncurses nepomuk newxkb nls nptl nptlonly odbc ogdi ogg openexr opengl openmp pam pam_chroot pcre perl plasma plugins png pppd pulseaudio python qt qt3 qt3support qt4 quicktime rdesktop readline reflection reiserfs samba sasl schroedinger screen sdl selinux server session skey slang spell spl sqlite3 sse sse2 ssl svg taglib tcltk tcpd telepathy theora threads tiff tls truetype truetype-fonts ucs2 udev unicode urandom usb userlocales utempter utils vnc vorbis xcb xcomposite xine xinerama xml xorg xv xvid zip 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 auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" CAMERAS="directory" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="it" USERLAND="GNU" VIDEO_CARDS="radeonhd radeon vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 1 Pierre-Yves Rofes (RETIRED) gentoo-dev 2009-01-07 15:46:23 UTC
Not a security issue, reassigning to maintainer.
Comment 2 Chris PeBenito (RETIRED) gentoo-dev 2009-08-17 17:10:33 UTC
I can't repoduce this on current (unstable) libselinux.  please reopen if is still an issue.