Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 561264 - sys-apps/portage-2.2.21 - PermissionError: [Errno 1] Operation not permitted: 'tasks' while interrupting emerge with FEATURES=cgroup
Summary: sys-apps/portage-2.2.21 - PermissionError: [Errno 1] Operation not permitted:...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on: 562964
Blocks: 549914
  Show dependency tree
 
Reported: 2015-09-23 13:51 UTC by Thomas Deutschmann (RETIRED)
Modified: 2015-11-04 00:04 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann (RETIRED) gentoo-dev 2015-09-23 13:51:18 UTC
Hi,

I was emerging dev-db/percona-server (the ebuild was running the test suite) when I pressed CTRL+C to stop. I got the following unexpected traceback:

rpl.rpl_semi_sync_uninstall_plugin 'stmt' w2 [ pass ]    296
rpl.rpl_stm_implicit_commit_binlog 'row' [ skipped ]  Doesn't support --binlog-format='row'
rpl.rpl_udf 'row'                        w1 [ pass ]    315
rpl.rpl_mixed_implicit_commit_binlog 'stmt' [ skipped ]  Doesn't support --binlog-format='statement'
rpl.rpl_row_implicit_commit_binlog 'stmt' [ skipped ]  Doesn't support --binlog-format='statement'
rpl.rpl_udf 'stmt'                       w2 [ pass ]    252
rpl.rpl_row_implicit_commit_binlog 'row' w3 [ pass ]   1743
rpl.rpl_row_sp011 'mix'                  [ skipped ]  Doesn't support --binlog-format='mixed'
^C

Exiting on signal 2
sandbox:stop  caught signal 2 in pid 1958
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/emerge", line 50, in <module>
    retval = emerge_main()
  File "/usr/lib64/python3.4/site-packages/_emerge/main.py", line 1161, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib64/python3.4/site-packages/_emerge/actions.py", line 3194, in run_action
    emerge_config.args, spinner)
  File "/usr/lib64/python3.4/site-packages/_emerge/actions.py", line 500, in action_build
    retval = mergetask.merge()
  File "/usr/lib64/python3.4/site-packages/_emerge/Scheduler.py", line 1028, in merge
    rval = self._merge()
  File "/usr/lib64/python3.4/site-packages/_emerge/Scheduler.py", line 1430, in _merge
    self._main_loop()
  File "/usr/lib64/python3.4/site-packages/_emerge/Scheduler.py", line 1407, in _main_loop
    self._event_loop.iteration()
  File "/usr/lib64/python3.4/site-packages/portage/util/_eventloop/EventLoop.py", line 270, in iteration
    if not x.callback(f, event, *x.args):
  File "/usr/lib64/python3.4/site-packages/portage/util/_async/PipeLogger.py", line 92, in _output_handler
    self.wait()
  File "/usr/lib64/python3.4/site-packages/_emerge/AsynchronousTask.py", line 57, in wait
    self._wait_hook()
  File "/usr/lib64/python3.4/site-packages/_emerge/AsynchronousTask.py", line 175, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib64/python3.4/site-packages/_emerge/SpawnProcess.py", line 168, in _pipe_logger_exit
    self.wait()
  File "/usr/lib64/python3.4/site-packages/_emerge/AsynchronousTask.py", line 54, in wait
    self._wait()
  File "/usr/lib64/python3.4/site-packages/_emerge/SubProcess.py", line 100, in _wait
    self._waitpid_loop()
  File "/usr/lib64/python3.4/site-packages/_emerge/SpawnProcess.py", line 171, in _waitpid_loop
    SubProcess._waitpid_loop(self)
  File "/usr/lib64/python3.4/site-packages/_emerge/SubProcess.py", line 106, in _waitpid_loop
    self.pid, self._waitpid_cb)
  File "/usr/lib64/python3.4/site-packages/portage/util/_eventloop/EventLoop.py", line 348, in child_watch_add
    self._poll_child_processes()
  File "/usr/lib64/python3.4/site-packages/portage/util/_eventloop/EventLoop.py", line 392, in _poll_child_processes
    x.callback(x.pid, wait_retval[1], x.data)
  File "/usr/lib64/python3.4/site-packages/_emerge/SubProcess.py", line 116, in _waitpid_cb
    self._set_returncode((pid, condition))
  File "/usr/lib64/python3.4/site-packages/_emerge/AbstractEbuildProcess.py", line 318, in _set_returncode
    shutil.rmtree(self.cgroup)
  File "/usr/lib64/python3.4/site-packages/portage/__init__.py", line 259, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
  File "/usr/lib64/python3.4/shutil.py", line 464, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/usr/lib64/python3.4/shutil.py", line 422, in _rmtree_safe_fd
    onerror(os.unlink, fullname, sys.exc_info())
  File "/usr/lib64/python3.4/shutil.py", line 420, in _rmtree_safe_fd
    os.unlink(name, dir_fd=topfd)
PermissionError: [Errno 1] Operation not permitted: 'tasks'


Reproducible: Always




# emerge --info
Portage 2.2.21 (python 3.4.3-final-0, default/linux/amd64/13.0, gcc-4.9.3, glibc-2.21-r1, 4.2.0-gentoo-r1 x86_64)
=================================================================
System uname: Linux-4.2.0-gentoo-r1-x86_64-Intel-R-_Core-TM-_i7-3770K_CPU_@_3.50GHz-with-gentoo-2.2
KiB Mem:     4023224 total,   1321800 free
KiB Swap:    1048572 total,   1043736 free
Timestamp of repository gentoo: Wed, 23 Sep 2015 12:45:01 +0000
sh bash 4.3_p42
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.0::gentoo
dev-lang/python:          2.7.10::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.3.2::gentoo
dev-util/pkgconfig:       0.28-r3::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.8::gentoo
sys-devel/autoconf:       2.69-r1::gentoo
sys-devel/automake:       1.13.4::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.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.2::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Comment 1 Zac Medico gentoo-dev 2015-09-27 07:48:40 UTC
This occurs just after SpawnProcess._set_returncode has been called, which sends SIGKILL to all processes in the cgroup. I guess this means that it takes some time for the processes to release that directory after we send SIGKILL. I suppose we could handle this case by scheduling rmtree to be retried later.
Comment 2 Zac Medico gentoo-dev 2015-09-27 23:28:19 UTC
There's a patch in the following branch:

https://github.com/zmedico/portage/tree/bug_561264

You can test it like this:

echo '=sys-apps/portage-9999 **' >> /etc/portage/package.accept_keywords
portage_LIVE_BRANCH=bug_561264 \
portage_LIVE_REPO=https://github.com/zmedico/portage.git \
emerge -1 =sys-apps/portage-9999

I've posted it for review here:

https://archives.gentoo.org/gentoo-portage-dev/message/1977808312134acca88f068a71a4eacd
Comment 3 Ryan Hill (RETIRED) gentoo-dev 2015-09-28 05:07:10 UTC
You'll also see this on any package that fails its testsuite with FEATURES=test-fail-continue enabled.  Patch fixes it for me.
Comment 4 Zac Medico gentoo-dev 2015-09-28 16:10:22 UTC
(In reply to Ryan Hill from comment #3)
> You'll also see this on any package that fails its testsuite with
> FEATURES=test-fail-continue enabled.  Patch fixes it for me.

Thanks for testing. This is in the master branch now:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=e6be71af3f67ea274db455e9c24d5f84bd372c39
Comment 5 Brian Dolbec (RETIRED) gentoo-dev 2015-10-09 15:05:56 UTC
Released in portage-2.2.23
Comment 6 Zac Medico gentoo-dev 2015-11-03 21:20:55 UTC
I've posted a related fix for review:

https://archives.gentoo.org/gentoo-portage-dev/message/e427b91ca12f3becb424e0f9aaca7bc3
Comment 7 Zac Medico gentoo-dev 2015-11-04 00:04:03 UTC
(In reply to Zac Medico from comment #6)
> I've posted a related fix for review:
> 
> https://archives.gentoo.org/gentoo-portage-dev/message/
> e427b91ca12f3becb424e0f9aaca7bc3

This is in the master branch now:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=21930f70b7c3b98c9b3c1ac7b3ebdd31581ec00b