dev-python/graph-tool-9999 and dev-python/graph-tool-2.2.36 both segfault on the standard import: $/usr/bin/python3.3 -c 'import graph_tool.all as gt' ; tail -n 1 /var/log/messages Segmentation fault Jan 19 04:42:12 localhost kernel: [196711.282646] python3.3[18903]: segfault at 16ae16 ip 000000000016ae16 sp 00007ffff2286a18 error 14 in libgmp.so.10.1.3[7f05c5edb000+78000] $/usr/bin/python2.7 -c 'import graph_tool.all as gt' ; tail -n 1 /var/log/messages Segmentation fault Jan 19 04:45:00 localhost kernel: [196878.961090] python2.7[18950]: segfault at 165526 ip 0000000000165526 sp 00007fffd26a6918 error 14 in libgmp.so.10.1.3[7fe6b5045000+78000] Reproducible: Always Steps to Reproduce: 1. install graph-tool (note bug 536734 and bug 537034 block this) 2. python -c 'import graph_tool.all as gt' Actual Results: $python -c 'import graph_tool.all as gt' Segmentation fault Expected Results: successful import I have both PAX and GRSEC disabled in the kernel for testing. $emerge --info graph-tool boost gmp Portage 2.2.14 (python 3.3.5-final-0, hardened/linux/amd64, gcc-4.8.3, glibc-2.17, 3.17.7-hardened-r1 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-3.17.7-hardened-r1-x86_64-Intel-R-_Xeon-R-_CPU_X5482_@_3.20GHz-with-gentoo-2.2 KiB Mem: 32958716 total, 374576 free KiB Swap: 33554428 total, 32378936 free Timestamp of tree: Mon, 19 Jan 2015 11:15:01 +0000 ld GNU ld (Gentoo 2.24 p1.4) 2.24 distcc 3.1 x86_64-pc-linux-gnu [disabled] ccache version 3.1.9 [enabled] app-shells/bash: 4.2_p53 dev-java/java-config: 2.2.0 dev-lang/perl: 5.16.3 dev-lang/python: 2.7.5-r3, 3.3.5-r1 dev-util/ccache: 3.1.9-r3 dev-util/cmake: 2.8.12.2 dev-util/pkgconfig: 0.28-r1 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.12.4 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.13, 2.69 sys-devel/automake: 1.9.6-r3, 1.10.3, 1.11.6, 1.12.6, 1.13.4 sys-devel/binutils: 2.24-r3 sys-devel/gcc: 4.6.3, 4.7.3-r1, 4.8.3, 4.9.1 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4.2-r1 sys-devel/make: 4.0-r1 sys-kernel/linux-headers: 3.13 (virtual/os-headers) sys-libs/glibc: 2.17 Repositories: gentoo poly-c local_overlay ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /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="-march=native -O2 -pipe" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://gentoo.mirrors.hoobly.com/ http://mirror.usu.edu/mirrors/gentoo/ ftp://gentoo.mirrors.tds.net/gentoo ftp://mirror.datapipe.net/gentoo" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j9" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/lib/layman/poly-c /usr/local/portage" SYNC="rsync://rsync.us.gentoo.org/gentoo-portage" USE="X alisp alsa amd64 amr apng aspell berkdb bindist bzip2 cairo celt clang cli cpudetection cracklib crypt cryptsetup cups cxx device-mapper dga dirac dri exif ffmpeg fftw fontconfig ftdi gcj gdbm geos gif glade glut gml gnuplot gps graphviz gstreamer gtk3 gudev hardened helpers hwdb iconv icu imagemagick introspection ipv6 ipython irqbalance jpeg jpeg2k justify keymap lapack latex lcms libkms lvm mad man mmx mmxext mng modules mp3 multilib ncat ncurses ndiff netcdf nls nping nptl ntfs numpy offensive ogg oog opengl openmp opus pam pax_kernel pcre pdf png postgres postscript pylint python qemu qt3support raw readline rtlsdr scipy sdl session smp smpeg spell spice sql sqlite sse sse2 ssl ssse3 svg tcpd threads tiff tinfo tools truetype unicode urandom usb v4l virt-network vorbis vpx wavelet webkit wmf x264 xa xattr xcb xetex xpm xtpax xvfb xvid zlib" ABI_X86="64" 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" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="multipath crypt" 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 ublox ubx" INPUT_DEVICES="keyboard synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_3" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="nouveau intel" 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" USE_PYTHON="2.7 3.3" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS ================================================================= Package Settings ================================================================= dev-python/graph-tool-9999 was built with the following: USE="cairo openmp" ABI_X86="64" PYTHON_TARGETS="python2_7 python3_3 -python3_4" dev-libs/boost-1.56.0-r1 was built with the following: USE="icu nls python threads tools -context -debug -doc -mpi -static-libs" ABI_X86="64 -32 -x32" PYTHON_TARGETS="python2_7 python3_3 -python3_4" CXXFLAGS="-march=native -O2 -pipe -std=gnu++98" dev-libs/gmp-5.1.3-r1 was built with the following: USE="cxx -doc -pgo -static-libs" ABI_X86="64 -32 -x32"
Would you care to get a gdb backtrace of that segmentation fault?
Quoting memory addresses isn't very useful here.
OK thanks. Learning. I enabled -ggdb and splitdebug, then recompiled python, gmp, boost, glibc, and graph-tool. backtraces and updated emerge --info attached line 99 of: https://github.com/count0/graph-tool/blob/master/src/graph/generation/graph_generation.cc seems to be the problem?
Created attachment 394374 [details] backtrace.log
Created attachment 394376 [details] backtrace.full.log
Created attachment 394378 [details] emerge.info
Was this just caused by bug #536734?
No, it was just dependent on it because you would get 'unknown symbol' instead of a segfault without first applying the fix for bug 536734. With the patch for 536734 applied, you can at least do some stuff, like: $/usr/bin/python3.3 -c 'import graph_tool ; print(graph_tool.__version__)' 2.2.37dev (commit 201879ac, Fri Jan 9 15:46:17 2015 +0100) which previously would give 'unknown symbol'
I posted a request for help upstream: http://thread.gmane.org/gmane.comp.science.graph.graph-tool.general/1807
Upstream suggested this might be a py2.7 vs 3.3 issue. I disabled python2.7: PYTHON_TARGETS="python3_3" PYTHON_SINGLE_TARGET="python3_3" USE_PYTHON='3.3' and recompiled boost, graph-tool, libgmp - and more. Same problem. LD_DEBUG="all" shows an unresolved symbol: <snip> 18820: /usr/lib64/python3.3/site-packages/graph_tool/generation/libgraph_tool_generation.so: error: symbol lookup error: undefined symbol: _ZNKSt3tr14hashISt6vectorISsSaISsEEEclES3_ (fatal) 18820: opening file=/usr/lib64/python3.3/site-packages/graph_tool/generation/libgraph_tool_generation.so [0]; direct_opencount=1 18820: 18820: 18820: add /usr/lib64/python3.3/site-packages/graph_tool/generation/libgraph_tool_generation.so [0] to global scope 18820: 18820: add /usr/lib64/libgmp.so.10 [0] to global scope 18820: symbol=PyInit_libgraph_tool_generation; lookup in file=/usr/lib64/python3.3/site-packages/graph_tool/generation/libgraph_tool_generation.so [0] 18820: binding file /usr/lib64/python3.3/site-packages/graph_tool/generation/libgraph_tool_generation.so [0] to /usr/lib64/python3.3/site-packages/graph_tool/generation/libgraph_tool_generation.so [0]: normal symbol `PyInit_libgraph_tool_generation' Segmentation fault $nm -D /usr/lib64/python3.3/site-packages/graph_tool/generation/libgraph_tool_generation.so | grep _ZNKSt3tr14hashISt6vectorISsSaISsEEEclES3_ U _ZNKSt3tr14hashISt6vectorISsSaISsEEEclES3_ $grep -r ZNKSt3tr14hashISt6vectorISsSaISsEEEclES3 /var/tmp/portage/dev-python/graph-tool-9999/ Binary file /var/tmp/portage/dev-python/graph-tool-9999/work/graph-tool-9999-python3_3/src/graph/generation/.libs/graph_rewiring.o matches Binary file /var/tmp/portage/dev-python/graph-tool-9999/work/graph-tool-9999-python3_3/src/graph/generation/.libs/libgraph_tool_generation.so matches $nm -D /usr/lib64/python3.3/site-packages/graph_tool/generation/libgraph_tool_generation.so | grep _ZNKSt3tr14hashISt6vectorISsSaISsEEEclES3_ U _ZNKSt3tr14hashISt6vectorISsSaISsEEEclES3_ $grep -r ZNKSt3tr14hashISt6vectorISsSaISsEEEclES3 /var/tmp/portage/dev-python/graph-tool-9999/ Binary file /var/tmp/portage/dev-python/graph-tool-9999/work/graph-tool-9999-python3_3/src/graph/generation/.libs/graph_rewiring.o matches Binary file /var/tmp/portage/dev-python/graph-tool-9999/work/graph-tool-9999-python3_3/src/graph/generation/.libs/libgraph_tool_generation.so matches With help from #gdb, I was able to instruction step to the segfault source, log graph_tool_segfault_gdb_log.txt attached, unfortunately I don't yet know how to break before 0x7fffd80982b0 changes, right now it's got the bad value already when I break on graph_generation.cc:99
Created attachment 395036 [details] graph_tool_segfault_gdb_log.txt
Per suggestion from upstream, I passed ./configure --disable-sparsehash, this resolved the segfault. Still working on understanding how to fix with sparsehash enabled. $/usr/bin/python3.3 -c 'import graph_tool.all as gt ; print(gt.__version__)' 2.2.37dev (commit 201879ac, Fri Jan 9 15:46:17 2015 +0100)
Created attachment 395102 [details] graph_tool_segfault_gdb_log_new.txt New log to assist upstream. This is with removetr1hash.patch applied and sparsehash enabled.
This is fixed in git, for 2.2.36 and 2.2.36-r1 the attached pach is needed. http://article.gmane.org/gmane.comp.science.graph.graph-tool.general/1826
Created attachment 396156 [details, diff] remove_all_tr1hash.patch Patch for graph-tool-2.2.36-r1 and graph-tool-2.2.36
I'm assuming this is fixed in 2.2.37 when it gets bumped.
Yes, it's fixed in 9999 now.
Closing since this should be fixed in more recent releases.