Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 554252 - =sys-apps/portage-2.2.20: sandbox ACCESS VIOLATION for dev-lang/python-3.3.5-r1 pyc files
Summary: =sys-apps/portage-2.2.20: sandbox ACCESS VIOLATION for dev-lang/python-3.3.5-...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 554468 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-07-08 18:01 UTC by anonymous
Modified: 2021-10-22 05:20 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,741.31 KB, text/x-log)
2015-07-08 18:03 UTC, anonymous
Details

Note You need to log in before you can comment on or make changes to this bug.
Description anonymous 2015-07-08 18:01:52 UTC
I can't update portage to 2.2.20:

>>> Install portage-2.2.20 into /var/tmp/portage/sys-apps/portage-2.2.20/image/ category sys-apps
 * python3_3: running distutils-r1_run_phase python_install
/usr/bin/python3.3 setup.py install --root=/var/tmp/portage/sys-apps/portage-2.2.20/image//_python3.3 --system-prefix=/usr --bindir=/usr/lib/python-exec/python3.3 --docdir=/usr/share/doc/portage-2.2.20 --htmldir=/usr/share/doc/portage-2.2.20/html --portage-bindir=/usr/lib/portage/python3.3 --sbindir=/usr/lib/python-exec/python3.3 --sysconfdir=/etc
 * ACCESS DENIED:  open_wr:      /usr/lib64/python3.3/__pycache__/weakref.cpython-33.pyc.140528045738168
 * ACCESS DENIED:  open_wr:      /usr/lib64/python3.3/__pycache__/zipfile.cpython-33.pyc.140528069833480
 * ACCESS DENIED:  open_wr:      /usr/lib64/python3.3/distutils/command/__pycache__/install.cpython-33.pyc.140528039170480

Reproducible: Always
Comment 1 anonymous 2015-07-08 18:03:14 UTC
Created attachment 406368 [details]
build.log
Comment 2 anonymous 2015-07-08 18:06:04 UTC
# emerge --info
Portage 2.2.18 (python 2.7.9-final-0, hardened/linux/amd64, gcc-4.8.4, glibc-2.20-r2, 4.1.1-gentoo-r1 x86_64)
=================================================================
System uname: Linux-4.1.1-gentoo-r1-x86_64-AMD_Phenom-tm-_II_X4_970_Processor-with-gentoo-2.2
KiB Mem:     8175168 total,     66668 free
KiB Swap:    4194300 total,   4194200 free
Timestamp of repository gentoo: Wed, 08 Jul 2015 17:30:01 +0000
sh bash 4.3_p33-r2
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.3_p33-r2::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.9-r1::gentoo, 3.3.5-r1::gentoo, 3.4.1::gentoo
dev-util/cmake:           3.2.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo
sys-devel/binutils:       2.24-r3::gentoo
sys-devel/gcc:            4.8.4::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: 3.18::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

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

mooyooma
    location: /var/lib/layman/mooyooma
    masters: gentoo
    priority: 0

rion
    location: /var/lib/layman/rion
    masters: gentoo
    priority: 1

kde
    location: /var/lib/layman/kde
    masters: gentoo
    priority: 2

wine-overlay
    location: /var/lib/layman/wine-overlay
    masters: gentoo
    priority: 3

steam-overlay
    location: /var/lib/layman/steam-overlay
    masters: gentoo
    priority: 4

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=amdfam10 -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /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"
CXXFLAGS="-O2 -pipe -march=amdfam10 -ggdb"
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="ftp://gentoo.kiev.ua/ ftp://portage.org.ua/"
LANG="uk_UA.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
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"
USE="X acl amd64 berkdb bzip2 cli cracklib crypt cxx dbus dri gdbm glamor gnutls hardened iconv ipv6 justify mmx mmxext modules multilib ncurses nls nptl opengl openmp pam pax_kernel pcre pie policykit qt3support qt5 readline seccomp session sse sse2 ssl ssp symlink systemd tcpd unicode urandom vdpau xattr xtpax 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" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" CURL_SSL="gnutls" 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="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="ru ru_RU en uk uk_UA" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby20" USERLAND="GNU" VIDEO_CARDS="radeon radeonsi 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 3 Magnus Granberg gentoo-dev 2015-07-08 21:31:30 UTC
Do you have emutramp enable in the kernel?
Comment 4 Magnus Granberg gentoo-dev 2015-07-08 21:33:32 UTC
(In reply to Magnus Granberg from comment #3)
> Do you have emutramp enable in the kernel?
Ignore that you don't run hardened kernel in the --info
Comment 5 Mike Gilbert gentoo-dev 2015-07-11 21:13:02 UTC
Please re-build dev-lang/python:3.3. Somehow your installed pyc files are stale.
Comment 6 anonymous 2015-07-12 12:15:41 UTC
(In reply to Mike Gilbert from comment #5)
> Please re-build dev-lang/python:3.3. Somehow your installed pyc files are
> stale.

Thank you, after re-build I successfully updated portage.
Comment 7 Zac Medico gentoo-dev 2015-07-12 17:53:17 UTC
*** Bug 554468 has been marked as a duplicate of this bug. ***
Comment 8 Zac Medico gentoo-dev 2015-07-12 18:03:52 UTC
@python: Is this a known issue with the python-3.3.5-r1 pyc files?
Comment 9 Mike Gilbert gentoo-dev 2015-07-12 18:50:49 UTC
(In reply to Zac Medico from comment #8)
> @python: Is this a known issue with the python-3.3.5-r1 pyc files?

It's a know issue for any pyc files. I always just assume the user has messed with the mod times on the corresponding py files.

If someone can present evidence of a systematic problem, we can address it.
Comment 10 Mike Gilbert gentoo-dev 2015-07-12 19:34:04 UTC
I have submitted a patch to distutils-r1.eclass for review.

http://thread.gmane.org/gmane.linux.gentoo.python/678
Comment 11 Stuart Longland 2015-07-17 16:18:22 UTC
(In reply to Mike Gilbert from comment #9)
> (In reply to Zac Medico from comment #8)
> > @python: Is this a known issue with the python-3.3.5-r1 pyc files?
> 
> It's a know issue for any pyc files. I always just assume the user has
> messed with the mod times on the corresponding py files.
> 
> If someone can present evidence of a systematic problem, we can address it.

Out of curiousity, which one of Catalyst's stages would be responsible for such "messing with mod times"?  My bash script merely generates spec files and points Catalyst at them, it doesn't touch any .py or .pyc files.

I had this problem last time I did a stage build several months back and had it again this time around when I reported the (duplicate) bug.  The funny thing being that I have FEATURES="-sandbox -usersandbox" in my environment (catalystrc).  Yet, sandbox still got dragged in and used.  My only workaround so far has been to temporarily unmerge sandbox right after Catalyst sets up the chroot in stage 2.
Comment 12 Stuart Longland 2015-07-17 16:21:35 UTC
I'm not sure if this might help somewhere when running portage's scripts:

COMMAND LINE OPTIONS
       -B     Don't write .py[co] files on import. See also 
              PYTHONDONTWRITEBYTECODE.

ENVIRONMENT VARIABLES
       PYTHONDONTWRITEBYTECODE
              If  this  is  set  to a non-empty string it is equivalent to 
              specifying the -B option (don't try to write .py[co] files).
Comment 13 Mike Gilbert gentoo-dev 2015-07-17 16:37:03 UTC
(In reply to Stuart Longland from comment #11)
> Out of curiousity, which one of Catalyst's stages would be responsible for
> such "messing with mod times"?  My bash script merely generates spec files
> and points Catalyst at them, it doesn't touch any .py or .pyc files.

I don't know, but if you can figure it out that would be helpful. I do not plan to start building my own stages just to try and debug this.

The only thing I can say is that python should not be trying to write there if the pyc files are in a consistent state.

> I had this problem last time I did a stage build several months back and had
> it again this time around when I reported the (duplicate) bug.  The funny
> thing being that I have FEATURES="-sandbox -usersandbox" in my environment
> (catalystrc).  Yet, sandbox still got dragged in and used.  My only
> workaround so far has been to temporarily unmerge sandbox right after
> Catalyst sets up the chroot in stage 2.

I can't help you with catalyst usage issues.
Comment 14 Stuart Longland 2015-07-18 20:31:13 UTC
(In reply to Mike Gilbert from comment #13)
> (In reply to Stuart Longland from comment #11)
> > Out of curiousity, which one of Catalyst's stages would be responsible for
> > such "messing with mod times"?  My bash script merely generates spec files
> > and points Catalyst at them, it doesn't touch any .py or .pyc files.
> 
> I don't know, but if you can figure it out that would be helpful. I do not
> plan to start building my own stages just to try and debug this.
> 
> The only thing I can say is that python should not be trying to write there
> if the pyc files are in a consistent state.
> 
> > I had this problem last time I did a stage build several months back and had
> > it again this time around when I reported the (duplicate) bug.  The funny
> > thing being that I have FEATURES="-sandbox -usersandbox" in my environment
> > (catalystrc).  Yet, sandbox still got dragged in and used.  My only
> > workaround so far has been to temporarily unmerge sandbox right after
> > Catalyst sets up the chroot in stage 2.
> 
> I can't help you with catalyst usage issues.

Right, because that's what my original bug was about in addition to above.
Comment 15 Mike Gilbert gentoo-dev 2015-07-18 23:32:59 UTC
  18 Jul 2015; Mike Gilbert <floppym@gentoo.org> distutils-r1.eclass:
  Add entire python directory to SANDBOX_PREDICT, bug 554252.
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-22 05:20:06 UTC

*** This bug has been marked as a duplicate of bug 256953 ***