I guess the problem is that if you have x11-libs/cairo[qt4] installed, libuuid is brought in with pygtk, while if you don't have it it is not. Simple testcase: python -c 'import gtk, uuid; print (uuid.uuid1().hex)' works if you have cairo[-qt4] segfaults with cairo[qt4]. Portage 2.1.9.31 (default/linux/amd64/10.0/desktop/gnome, gcc-4.5.2-asneeded, glibc-2.12.2-r0, 2.6.37 x86_64) ================================================================= System uname: Linux-2.6.37-x86_64-Intel-R-_Atom-TM-_CPU_D525_@_1.80GHz-with-gentoo-2.0.1 Timestamp of tree: Mon, 17 Jan 2011 10:00:01 +0000 distcc 3.1 x86_64-pc-linux-gnu [enabled] app-shells/bash: 4.1_p9 dev-lang/python: 2.6.6-r1 dev-util/cmake: 2.8.3-r1 sys-apps/baselayout: 2.0.1-r1 sys-apps/openrc: 0.7.0 sys-apps/sandbox: 2.4 sys-devel/autoconf: 2.13, 2.68 sys-devel/automake: 1.9.6-r3, 1.10.3, 1.11.1 sys-devel/binutils: 2.21 sys-devel/gcc: 4.5.2 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82 virtual/os-headers: 2.6.36.1 (sys-kernel/linux-headers) ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA skype-eula AdobeFlash-10.1" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -fomit-frame-pointer -march=atom" 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/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="-O2 -pipe -fomit-frame-pointer -march=atom" DISTDIR="/var/cache/portage/distfiles" FEATURES="assume-digests binpkg-logs distcc distlocks fail-clean fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox" GENTOO_MIRRORS="http://gentoo.wheel.sk/" LANG="en_US.utf8" LDFLAGS="-Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,-z,now" LINGUAS="it en" MAKEOPTS="-s -j5" PKGDIR="/usr/portage/packages" PORTAGE_COMPRESS="xz" 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/cache/portage/tree" PORTDIR_OVERLAY="/var/lib/layman/flameeyes-overlay /var/lib/layman/tante" SYNC="rsync://yamato.home.flameeyes.eu/gentoo-portage" USE="X a52 aac acl acpi alsa amd64 avahi berkdb bluetooth branding bzip2 cairo caps cdr cli consolekit crypt cups custom-cflags custom-optimization cxx dbus dri dts dvd dvdr eds emacs emboss encode evo exif firefox flac fortran gdbm gdu gif gmp gnome gnome-keyring gstreamer gtk iconv idn ipv6 jpeg lcms libnotify mad mikmod mmx mng modules mp3 mp4 mpeg mudflap multicall multilib nautilus ncurses nls nptl nptlonly ogg opengl openmp pam pango pcre pdf perl png policykit ppds pppd pulseaudio qt3support qt4 readline sdl session smartcard spell sse sse2 sse3 ssl ssse3 startup-notification svg sysfs tiff truetype udev unicode usb vorbis x264 xattr xcb xml xmp xorg xulrunner xv xvid 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" 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="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="it en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" SANE_BACKENDS="snapscan" USERLAND="GNU" VIDEO_CARDS="nvidia" 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_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
I cannot reproduce: $ python -c 'import gtk, uuid; print (uuid.uuid1().hex)' ** Message: pygobject_register_sinkfunc is deprecated (GtkWindow) ** Message: pygobject_register_sinkfunc is deprecated (GtkInvisible) ** Message: pygobject_register_sinkfunc is deprecated (GtkObject) $ echo $? 0 I have the following: [ebuild R ] dev-python/pygtk-2.17.0 USE="test -doc -examples" 0 kB [ebuild R ] x11-libs/cairo-1.10.2-r1 USE="X opengl qt4 svg xcb (-aqua) -debug -directfb -doc (-drm) (-gallium) (-openvg) -static-libs" 0 kB
I can - same cairo, but dev-python/pygtk-2.22.0. No debugging symbols, but may help anyway: #0 0xb5c4425d in uuid_generate_time () from /lib/libuuid.so.1 #1 0xb787c677 in ffi_call_SYSV () from /usr/lib/libffi.so.5 #2 0xb787c4ce in ffi_call () from /usr/lib/libffi.so.5 #3 0xb5ad1997 in _ctypes_callproc () from /usr/lib/python2.7/lib-dynload/_ctypes.so #4 0xb5acb7ba in ?? () from /usr/lib/python2.7/lib-dynload/_ctypes.so #5 0xb7e7cc1a in PyObject_Call () from /usr/lib/libpython2.7.so.1.0 #6 0xb7f148ac in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0 #7 0xb7f16c8f in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0 #8 0xb7f15471 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0 #9 0xb7f16c8f in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0 #10 0xb7f16dd3 in PyEval_EvalCode () from /usr/lib/libpython2.7.so.1.0 #11 0xb7f302db in ?? () from /usr/lib/libpython2.7.so.1.0 #12 0xb7f30f85 in PyRun_StringFlags () from /usr/lib/libpython2.7.so.1.0 #13 0xb7f31c24 in PyRun_SimpleStringFlags () from /usr/lib/libpython2.7.so.1.0 #14 0xb7f43396 in Py_Main () from /usr/lib/libpython2.7.so.1.0 #15 0x080487d3 in main ()
Yes that the same trace I got.
pygtk-2.22 is not in tree for a reason... It does not pass its testsuite as reported upstream.
Also works ok for me with 2.22 :-/, maybe the problem is related by you using python-2.7?
(In reply to comment #5) > Also works ok for me with 2.22 :-/, maybe the problem is related by you using > python-2.7? > No, info says 2.6.6-r1.
Yes, I don't know where is the problem then :-/ Flameeyes, what pygtk version are you using? (original report doesn't shows it). Thanks
I can reproduce segmentation fault with both x11-libs/cairo-1.10.2-r1[qt4] and x11-libs/cairo-1.10.2-r1[-qt4].
And what pygtk version are you running?
Make sure you've been using --as-needed otherwise you need to rebuild more than just cairo[-qt4] (as QtGui, libSM and libuuid would be added to _more_ needed lists). dev-python/pygtk-2.17.0 here; problem happens both with 2.7 and 2.6 (I did downgrade thinking it was 2.7 problem).
OK, the difference in ldd output between qt4 and -qt4 is that with qt4, cairo links indirectly to libuuid via libQtGui.so.4 -> libSM.so.6. But why does python throw a fit about it ?
Yes that's the middle-cause of it; the root cause I don't know, it seems like Python makes a mess if libuuid is loaded before the uuid extension is imported. Zac also hit that with calibre before FWIW (if he didn't tell me about the order issue I'd never have found this problem).
(In reply to comment #11) > OK, the difference in ldd output between qt4 and -qt4 is that > with qt4, cairo links indirectly to libuuid via libQtGui.so.4 -> libSM.so.6. Maybe it's a duplicate of bug 317557 since that also involves qt libraries.
Sorta, the trace there is for the random uuid, this for the time uuid, so they are most definitely related but not the same issue.
Perhaps the problem lies not in pygtk/PyQt4, but in a way python/ctypes loads/unloads libraries ?
Fun, now it seems to break in many other ways: flame@raven ~ % python Python 2.6.6 (r266:84292, Jan 16 2011, 22:31:06) [GCC 4.5.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pynotify ** Message: pygobject_register_sinkfunc is deprecated (GtkWindow) ** Message: pygobject_register_sinkfunc is deprecated (GtkInvisible) ** Message: pygobject_register_sinkfunc is deprecated (GtkObject) >>> import uuid >>> uuid.uuid1().hex zsh: segmentation fault python so yes we have a problem here. Moving to python.
Well, if you still have cairo[qt4], it may actually be exactly the same way - something bad happens if cairo linked with QtGui is opened by python.
It filters through on other libraries if --as-needed is not entirely forced like I have suggested many times (as Arfrever can tell, LD_AS_NEEDED no longer works). We're going to have to look for the original problem in python's uuid.
The root cause might be some TLS issues in libuuid (just taking a wild guess...)
Seems the shortest way is "python -c 'import cairo, uuid; print (uuid.uuid1().hex)'".
Does anyone have an idea if the patch from bug 353224 is the proper solution ?
(In reply to comment #20) > Seems the shortest way is "python -c 'import cairo, uuid; print > (uuid.uuid1().hex)'". Well, as this works with glibc 2.13-r4, it most likely was the same problem as in bug 353224. Would be nice if backported to 2.12, unless 2.13-r4 is getting into stable soon.
(In reply to comment #22) > (In reply to comment #20) > > Seems the shortest way is "python -c 'import cairo, uuid; print > > (uuid.uuid1().hex)'". > > Well, as this works with glibc 2.13-r4, it most likely was the same problem as > in bug 353224. > > Would be nice if backported to 2.12, unless 2.13-r4 is getting into stable > soon. glibc-2.13-r4 is already stable on most arches, anything else to do here?
Closing