Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 692178 - =dev-python/pip-19.2.2: dbus starts during install if dev-python/keyring is installed - sandbox error ACCESS DENIED: open_wr: /proc/self/oom_score_adj
Summary: =dev-python/pip-19.2.2: dbus starts during install if dev-python/keyring is i...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-15 05:34 UTC by Nick
Modified: 2020-01-17 16:27 UTC (History)
5 users (show)

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


Attachments
pip-19.2.2.build.log (pip-19.2.2.build.log,742.03 KB, text/plain)
2019-08-15 05:34 UTC, Nick
Details
xfce4-screenshooter's build log (build.log,109.99 KB, text/plain)
2019-11-18 03:58 UTC, Amit Ugol
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick 2019-08-15 05:34:41 UTC
Created attachment 586806 [details]
pip-19.2.2.build.log

emerge -pv1 dev-python/pip

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ~] dev-python/pip-19.2.2::gentoo [19.1::gentoo] USE="-test -vanilla" PYTHON_TARGETS="python2_7 python3_5 python3_6 python3_7 -pypy -pypy3" 0 KiB

Total: 1 package (1 upgrade), Size of downloads: 0 KiB


 * python3_7: running distutils-r1_run_phase python_install_all
 * ACCESS DENIED:  open_wr:      /proc/self/oom_score_adj
 * ACCESS DENIED:  open_wr:      /proc/self/oom_score_adj
>>> Completed installing dev-python/pip-19.2.2 into /var/tmp/portage/dev-python/pip-19.2.2/image

 * Final size of build directory: 33872 KiB (33.0 MiB)
 * Final size of installed tree:  65152 KiB (63.6 MiB)

 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
 * LOG FILE: "/var/log/sandbox/sandbox-4.log"
 * 
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /proc/self/oom_score_adj
A: /proc/self/oom_score_adj
R: /proc/703/oom_score_adj
C: /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session 

F: open_wr
S: deny
P: /proc/self/oom_score_adj
A: /proc/self/oom_score_adj
R: /proc/703/oom_score_adj
C: /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session 
 * --------------------------------------------------------------------------------

>>> Failed to emerge dev-python/pip-19.2.2


Portage 2.3.69 (python 3.6.9-final-0, default/linux/amd64/17.0/desktop/gnome/systemd, gcc-8.3.0, glibc-2.29-r2, 5.2.8-gentoo x86_64)
=================================================================
System uname: Linux-5.2.8-gentoo-x86_64-Intel-R-_Core-TM-_i7-7700HQ_CPU_@_2.80GHz-with-gentoo-2.6
KiB Mem:    16372960 total,   6938092 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Thu, 15 Aug 2019 00:45:01 +0000
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.31.1 p7) 2.31.1
app-shells/bash:          4.4_p23-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.2-r1::gentoo
dev-lang/python:          2.7.16::gentoo, 3.5.7::gentoo, 3.6.9::gentoo, 3.7.4-r1::gentoo
dev-util/cmake:           3.14.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.13.4-r2::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r6::gentoo, 2.32-r1::gentoo
sys-devel/gcc:            7.4.0-r2::gentoo, 8.3.0-r1::gentoo, 9.1.0-r1::gentoo, 9.2.0::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: webrsync
    sync-uri: #rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-webrsync-verify-signature: yes

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.mirrors.tds.net/gentoo http://cosmos.illinois.edu/pub/gentoo/ http://gentoo.osuosl.org/ http://distfiles.gentoo.org/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
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 a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli colord crypt cuda cups cxx dbus dri dts dvd dvdr eds emboss encode evo exif fam flac fortran gdbm gif glamor gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk ibus iconv icu introspection ipv6 jpeg lcms libass libnotify libsecret libtirpc mad mmx mng modplug mp3 mp4 mpeg multilib nautilus ncurses networkmanager nls nptl ogg opencl opengl openmp opus pam pango pcre pdf png policykit ppds pulseaudio qt5 readline sdl seccomp spell split-usr sse sse2 ssl startup-notification svg systemd tcpd tiff tracker truetype udev udisks unicode upower usb vaapi vdpau vorbis wxwidgets x264 xattr xcb xml xv 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_5 python3_6 python3_7" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="intel i965 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Mike Gilbert gentoo-dev 2019-08-15 15:51:18 UTC
Something is starting an instance of dbus-daemon when the ebuild runs setup.py install.

Nothing in dev-python/pip would launch dbus-daemon.

Probably some other python package has some code that does this. Could you grep around in /usr/lib/python3.7/site-packages for anything dbus-related?
Comment 2 Nick 2019-09-05 15:14:28 UTC
Interestingly, I can reproduce successfully reinstalling =dev-python/pip-19.1 and still =dev-python/pip-19.2.2 fails with the sandbox error. The ebuild and use flags didn't change so regardless of the true underlying cause _something_ must have changed in the source itself to trigger this problem, but I haven't found anything obvious yet from a diff between the two unpacked source directories.

emerge -pv1 =dev-python/pip-19.1

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] dev-python/pip-19.1::gentoo  USE="-test -vanilla" PYTHON_TARGETS="python2_7 python3_5 python3_6 python3_7 -pypy -pypy3" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

emerge -pv1 dev-python/pip

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ~] dev-python/pip-19.2.2::gentoo [19.1::gentoo] USE="-test -vanilla" PYTHON_TARGETS="python2_7 python3_5 python3_6 python3_7 -pypy -pypy3" 0 KiB

Total: 1 package (1 upgrade), Size of downloads: 0 KiB
Comment 3 Mike Gilbert gentoo-dev 2019-09-05 16:01:18 UTC
Sorry, but I still cannot reproduce this. If you are able to provide more useful information, feel free to re-open.
Comment 4 Frédéric Barthelery 2019-09-05 17:45:03 UTC
For me it's triggered by dev-python/keyring.
I don't know all the details but when the ebuild runs `pip completion --bash` (or the equivalent command) it seems to load/import a lot of python packages. 
I was able to find this by running this command

`python3 -m trace --trace /usr/bin/pip3 completion --bash > /tmp/trace.log`

When keyring is installed it imports dbus and probably launch the dbus-daemon.
Comment 5 Vadim Dyadkin 2019-09-22 13:59:31 UTC
Yes, I have noticed the same, when I uninstall dev-python/keyring, pip emerges perfectly fine.
Comment 6 Nick 2019-09-22 16:09:12 UTC
I had dev-python/keyring pulled in due to no longer needed dev-python/oauth2client, I could reproduce successful install of =dev-python/pip-19.2.2 by uninstalling dev-python/keyring and dependencies and then installing =dev-python/pip-19.2.2.

Installing dev-python/keyring should reproduce the build failure.
Comment 7 Greg Turner 2019-10-13 21:44:03 UTC
Well spotted Frédéric!

Dear python team,

This seems like it's a legit bug*

Until more is known, perhaps pip-19.2.2 should DEPEND-block dev-python/keyring or something like that?

If you would like to repro/investigate:

(In comment #6 Nick says)
> Installing dev-python/keyring should reproduce the build failure.

(In comment #4 Frédéric Barthelery says approximately)
> the [=dev-python/pip-19.2.2] ebuild runs
>
>   `pip completion --bash`
>
> [which seems to import dbus if keyring is installed,
> which causes a sandbox violation]

Thank you kindly for all the amazing work you do!

--
* or, at least, a common mis-configuration that gentoo ought to find a way to handle more gracefully.
Comment 8 Amit Ugol 2019-11-18 03:58:31 UTC
Created attachment 596606 [details]
xfce4-screenshooter's build log
Comment 9 Amit Ugol 2019-11-18 04:00:17 UTC
(In reply to Amit Ugol from comment #8)
> Created attachment 596606 [details]
> xfce4-screenshooter's build log

No idea why is removed my text...
Not sure if directly related but same symptoms with xfce4-screenshooter, and I don't have keyring installed at all on my system.
Comment 10 Amit Ugol 2019-11-18 04:04:34 UTC
(In reply to Amit Ugol from comment #9)
> (In reply to Amit Ugol from comment #8)
> > Created attachment 596606 [details]
> > xfce4-screenshooter's build log
> 
> No idea why is removed my text...
> Not sure if directly related but same symptoms with xfce4-screenshooter, and
> I don't have keyring installed at all on my system.

Sorry for the broken messages... long day. To work around it I opened a new terminal (alt+shift_F2 in my case) logged in as root and compiled. So it might not be relevant exactly to this issue after all...
Comment 11 Larry the Git Cow gentoo-dev 2020-01-17 16:27:28 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0150f444229b0d6ebdd6e44044e1fe436e6c728a

commit 0150f444229b0d6ebdd6e44044e1fe436e6c728a
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-01-17 16:27:06 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-01-17 16:27:23 +0000

    dev-python/pip: attempt to prevent dbus auto-launch
    
    Closes: https://bugs.gentoo.org/692178
    Package-Manager: Portage-2.3.84_p2, Repoman-2.3.20_p24
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 dev-python/pip/pip-19.1.ebuild      | 4 ++++
 dev-python/pip/pip-19.3.1-r1.ebuild | 4 ++++
 dev-python/pip/pip-19.3.1-r2.ebuild | 4 ++++
 3 files changed, 12 insertions(+)