Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 582770 - dev-util/bcc-0.1.8: *** Error in `python2.7': free(): invalid pointer: 0x00007fe48e4277e0 ***
Summary: dev-util/bcc-0.1.8: *** Error in `python2.7': free(): invalid pointer: 0x0000...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: Zac Medico
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2016-05-11 18:11 UTC by Mateusz Lenik
Modified: 2016-09-16 19:00 UTC (History)
1 user (show)

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


Attachments
hello_world.py crash backtrace (backtrace,37.85 KB, text/plain)
2016-05-11 18:11 UTC, Mateusz Lenik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mateusz Lenik 2016-05-11 18:11:31 UTC
Created attachment 433980 [details]
hello_world.py crash backtrace

dev-util/bcc aborts when compiling the probe, backtrace of hello_world.py example attached.
Possibly related to LLVM version and https://bugs.gentoo.org/show_bug.cgi?id=581076

# emerge --info llvm bcc
Portage 2.2.28 (python 2.7.10-final-0, default/linux/amd64/13.0, gcc-4.9.3, glibc-2.22-r4, 4.6.0-rc7 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.6.0-rc7-x86_64-Intel-R-_Core-TM-_i7-6600U_CPU_@_2.60GHz-with-gentoo-2.2
KiB Mem:    16334616 total,   2626260 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Wed, 11 May 2016 07:00:01 +0000
sh bash 4.3_p42-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42-r1::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.12.6::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.5::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

mlen
    location: /var/lib/layman/mlen
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -fno-omit-frame-pointer -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
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="-O2 -march=native -fno-omit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs 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://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5 -l5"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X aac aacplus acl alsa amd64 audit berkdb bzip2 caps cgroups cli cracklib crypt cryptsetup cups cxx dbus dri faac flac fortran gdbm gif gtk gtk3 gtkstyle iconv idn infinality iproute2 ipv6 jpeg libedit libnotify llvm lvm mmx mmxext modules mp3 mpeg multilib ncurses networkmanager nls nptl ogg opengl openmp opus oss pam pch pcre png policykit pulseaudio python qt5 readline seccomp session sound sse sse2 ssl startup-notification systemd tcpd theora tiff truetype udev udisks unicode unwind vdpau vim-syntax virt-network vorbis webp x264 xattr xft xinerama zlib zsh-completion" 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" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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="synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby23 ruby21" USERLAND="GNU" VIDEO_CARDS="intel i965" 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-devel/llvm-3.7.1::gentoo was built with the following:
USE="clang libedit libffi lldb multitarget ncurses python static-analyzer xml -debug -doc -gold -ocaml -test" ABI_X86="64 -32 -x32" PYTHON_TARGETS="python2_7" VIDEO_CARDS="-radeon"


dev-util/bcc-0.1.8::gentoo was built with the following:
USE="" ABI_X86="64" PYTHON_SINGLE_TARGET="python2_7 -python3_4 -python3_5" PYTHON_TARGETS="python2_7 python3_4 -python3_5"
Comment 1 Jeremi Piotrowski 2016-05-22 18:31:03 UTC
I had the same problem, it is caused by libbcc.so being statically linked to libstdc++ and dynamically to libLLVM* and libclang*, which in turn are dynamically linked to libstdc++. When this static linking of libstdc++ is disabled the bcc tools work fine.

Probably should be resolved with upstream (as in - if LLVM static libs are not available then don't statically link with libstdc++) but for the time being the following change to the ebuild has allowed me to get it working:

--- /usr/portage/dev-util/bcc/bcc-0.1.8.ebuild	2016-04-11 09:28:08.000000000 +0200
+++ bcc-0.1.8.ebuild	2016-05-22 20:16:53.977004378 +0200
@@ -36,6 +36,12 @@ pkg_setup() {
 	python-single-r1_pkg_setup
 }
 
+src_prepare() {
+	# don't use static libstdc++
+	sed -i -e '21,33d' src/cc/CMakeLists.txt
+	default
+}
+
 src_configure() {
 	local mycmakeargs=(
 		-DREVISION=${PV%%_*}
Comment 2 Zac Medico gentoo-dev 2016-05-23 17:50:23 UTC
(In reply to Jeremi Piotrowski from comment #1)

Thanks! It's fixed in bcc-0.1.8-r1:

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef9977bda2bd7239b2092a61a888e954e7725eaa
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f159e1f5453da3b97ec26889b5c585a198fed756

I still need to look into sending a fix upstream.
Comment 3 Jeremi Piotrowski 2016-09-15 07:55:14 UTC
This has been fixed in upstream commit

     2d2958919af8aebe04c5a8ff0d19d6b060b757cb

which is part of v0.2.0. This bug can be closed.
Comment 4 Zac Medico gentoo-dev 2016-09-16 19:00:13 UTC
(In reply to Jeremi Piotrowski from comment #3)
> This has been fixed in upstream commit
> 
>      2d2958919af8aebe04c5a8ff0d19d6b060b757cb
> 
> which is part of v0.2.0. This bug can be closed.

Thanks! I've added a 0.2.0 ebuild to the tree.