Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 354515 - dev-lang/python- segfaults while importing hashlib in virtualenv
Summary: dev-lang/python- segfaults while importing hashlib in virtualenv
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-11 19:58 UTC by Motiejus Jakštys
Modified: 2011-02-15 13:44 UTC (History)
1 user (show)

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


Attachments
(env) python -v paster serve app.ini (debug_paster.txt,32.28 KB, text/plain)
2011-02-11 20:10 UTC, Motiejus Jakštys
Details
python gdb backtrace (paster-gdb.txt,10.58 KB, text/plain)
2011-02-11 20:12 UTC, Motiejus Jakštys
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Motiejus Jakštys 2011-02-11 19:58:06 UTC
When loading Paster web server, python crashes while importing hashlib:
motiejus@stopas:~/code/proj/env/bin$ ./python -v ./paster serve ../../proj/development.ini

/home/motiejus-gentoo/code/proj/env/lib/python2.6/site-packages/pycrypto-2.0.1-py2.6-linux-i686.egg/Crypto/Hash/SHA.py:6: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
# /usr/lib/python2.6/hashlib.pyc matches /usr/lib/python2.6/hashlib.py
import hashlib # precompiled from /usr/lib/python2.6/hashlib.pyc
dlopen("/home/motiejus-gentoo/code/proj/env/lib/python2.6/lib-dynload/_hashlib.so", 2);
import _hashlib # dynamically loaded from /home/motiejus-gentoo/code/proj/env/lib/python2.6/lib-dynload/_hashlib.so
Segmentation fault

Strangely, importing hashlib from shell within the same virtualenv does not make it crash.

It stopped working after full system upgrade.
I will attach gdb backtrace in a moment.

Reproducible: Always

Steps to Reproduce:
1. create virtualenv and install paster
2. get any app that uses paster webserver
3. $ paster serve app.ini
Actual Results:  
Segmentation fault

Expected Results:  
Server starts running

motiejus@stopas:~$ emerge --info
Portage 2.1.9.25 (default/linux/x86/10.0/desktop/gnome, gcc-4.4.4, glibc-2.11.2-r3, 2.6.37-gentoo i686)
=================================================================
System uname: Linux-2.6.37-gentoo-i686-Intel-R-_Core-TM-2_Duo_CPU_T7250_@_2.00GHz-with-gentoo-2.0.1
Timestamp of tree: Wed, 09 Feb 2011 08:45:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 2.4 [disabled]
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/ccache:     2.4-r9
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.6.3
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
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 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/openvpn/easy-rsa /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /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"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.tiscali.nl/ http://gentoo.virginmedia.com/ http://de-mirror.org/distro/gentoo/ http://gentoo.mneisen.org/"
LANG="lt_LT.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en lt de ru"
MAKEOPTS="-j3 -s"
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="/var/lib/layman/sunrise"
SYNC="rsync://rsync3.nl.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl acpi alsa amr atm bash-completion battery berkdb binary-drivers bluetooth branding bzip2 cairo cdda cddb cdr chm cleartype cli consolekit corefonts cracklib crypt css cups curl cxx dbus dell dhcp dirac directfb djvu dri dts dvd dvdr dvi emboss encode espeak evdev exif extensions faac faad fam fastcgi fat fbcon ffmpeg firefox flac fontconfig fortran ftp fuse gdbm gdu geoip gif gimp gnome gnome-keyring gnutls gpg gphoto2 gpm gps gs gstreamer gtk h323 hardware-carrier hpcups http iconv imagemagick iproute2 ipv6 jack java java6 javascript jingle jpeg kpathsea ladspa lame laptop lcms ldap libcaca libnotify lm_sensors logrotate lyrics lzma mad matroska mikmod mjpeg mmx mmxext mng modules moonlight mouse mp3 mp4 mpd mpeg mplayer mudflap mysql nas nautilus ncurses networking networkmanager nfs nfsv3 nfsv4 nls nokia nptl nptlonly nsplugin ntfs ntp nvidia ogg opengl openmp pam pango pcre pdf perl png policykit ppds pppd ps python python3 qt3support qt4 quicktime radvd rar readline rss rtsp samba samba4 scanner sdl sensord session socks5 speex spell sse sse2 sse3 ssl ssse3 startup-notification svg symlink synaptics sysfs syslog t1lib tcpd tga theora threads tiff timidity tk transparent-proxy truetype type3 udev unicode unzip usb v4l v4l2 vcd vhosts vim vim-syntax vorbis wav wavpack webcam wifi win32codecs wma wmf x11vnc x264 x86 xcb xml xorg xrandr xulrunner xv xvid zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en lt de ru" 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" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Motiejus Jakštys 2011-02-11 20:10:16 UTC
Created attachment 262157 [details]
(env) python -v paster serve app.ini

run /home/motiejus-gentoo/code/proj/env/bin/paster serve /home/motiejus-gentoo/code/proj/proj/development.ini
Comment 2 Motiejus Jakštys 2011-02-11 20:12:14 UTC
Created attachment 262159 [details]
python gdb backtrace

(env)motiejus@stopas:~/code/proj/proj$ gdb python
...
(gdb) run ../env/bin/paster serve development.ini
Comment 3 Motiejus Jakštys 2011-02-11 20:16:13 UTC
(In reply to comment #1)
> Created an attachment (id=262157) [details]
> python gdb backtrace
Sorry for confusion, it's really just python -v to show where it crashes.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2011-02-15 13:44:32 UTC
This certainly doesn't look like it's Gentoo's business. Whatever sits in /home/motiejus-gentoo/code is yours, and the several problems (bundled and outdated code, mixing system python with a python binary that appears to be running from a user-local directory) you are seeing could be resolved if that "paster" package would rely on the system-installed packages instead of bundled ones. The bundled python binary appears to mix its own files with the system files - you could probably unset some python related paths in your environment to get over that, but the question would remain if that's what you really want, rather than writing your own ebuild and installing with that package exactly what "parser" needs of its own and none of what Gentoo cannot provide.