Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 538314 - sys-apps/portage: hitting CTRL+Z while merging at the wrong time can wrongly crash
Summary: sys-apps/portage: hitting CTRL+Z while merging at the wrong time can wrongly ...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 484436
  Show dependency tree
 
Reported: 2015-01-31 07:42 UTC by SpanKY
Modified: 2015-02-12 06:08 UTC (History)
0 users

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 SpanKY gentoo-dev 2015-01-31 07:42:24 UTC
Portage 2.2.12 (python 2.7.8-final-0, default/linux/mips/13.0/mipsel/multilib/n32, gcc-4.8.3, glibc-2.19-r1, 3.5.0-2.lemote mips64)

>>> Emerging (1 of 1) sys-apps/hdparm-9.45::gentoo
>>> Installing (1 of 1) sys-apps/hdparm-9.45::gentoo
>>> Jobs: 0 of 1 complete, 1 running                Load avg: 5.67, 5.35, 5.36^Z
[1]+  Stopped                 emerge hdparm -1avu --jobs 2
root@lemote 1:152 ~ # bg
[1]+ emerge hdparm -1avu --jobs 2 &
root@lemote 1:0 ~ #
hdTraceback (most recent call last):
  File "/usr/bin/emerge", line 51, in <module>
    retval = emerge_main()
  File "/usr/lib/portage/pym/_emerge/main.py", line 1057, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib/portage/pym/_emerge/actions.py", line 4067, in run_action
    emerge_config.args, spinner)
  File "/usr/lib/portage/pym/_emerge/actions.py", line 454, in action_build
    retval = mergetask.merge()
  File "/usr/lib/portage/pym/_emerge/Scheduler.py", line 1022, in merge
    rval = self._merge()
  File "/usr/lib/portage/pym/_emerge/Scheduler.py", line 1411, in _merge
    self._main_loop()
  File "/usr/lib/portage/pym/_emerge/Scheduler.py", line 1388, in _main_loop
    self._event_loop.iteration()
  File "/usr/lib/portage/pym/portage/util/_eventloop/EventLoop.py", line 270, in iteration
    if not x.callback(f, event, *x.args):
  File "/usr/lib/portage/pym/portage/util/_async/PipeLogger.py", line 133, in _output_handler
    self._unregister_if_appropriate(event)
  File "/usr/lib/portage/pym/_emerge/AbstractPollTask.py", line 129, in _unregister_if_appropriate
    self.wait()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 57, in wait
    self._wait_hook()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 175, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib/portage/pym/_emerge/SpawnProcess.py", line 168, in _pipe_logger_exit
    self.wait()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 57, in wait
    self._wait_hook()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 175, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib/portage/pym/_emerge/EbuildPhase.py", line 296, in _post_phase_exit
    self.wait()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 57, in wait
    self._wait_hook()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 175, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib/portage/pym/_emerge/TaskSequence.py", line 52, in _task_exit_handler
    self.wait()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 57, in wait
    self._wait_hook()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 175, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib/portage/pym/_emerge/CompositeTask.py", line 134, in _default_final_exit
    return self.wait()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 57, in wait
    self._wait_hook()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 175, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib/portage/pym/_emerge/EbuildBuild.py", line 302, in _build_exit
    self.wait()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 57, in wait
    self._wait_hook()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 175, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib/portage/pym/_emerge/CompositeTask.py", line 134, in _default_final_exit
    return self.wait()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 57, in wait
    self._wait_hook()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 175, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib/portage/pym/_emerge/Scheduler.py", line 1333, in _build_exit
    self._task_queues.merge.add(merge)
  File "/usr/lib/portage/pym/_emerge/SequentialTaskQueue.py", line 23, in add
    self.schedule()
  File "/usr/lib/portage/pym/_emerge/SequentialTaskQueue.py", line 45, in schedule
    task.start()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 30, in start
    self._start()
  File "/usr/lib/portage/pym/_emerge/PackageMerge.py", line 44, in _start
    self._start_task(task, self._default_final_exit)
  File "/usr/lib/portage/pym/_emerge/CompositeTask.py", line 151, in _start_task  
    task.start()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 30, in start
    self._start()
  File "/usr/lib/portage/pym/_emerge/EbuildMerge.py", line 34, in _start
    self._start_task(merge_task, self._merge_exit)
  File "/usr/lib/portage/pym/_emerge/CompositeTask.py", line 151, in _start_task  
    task.start()
  File "/usr/lib/portage/pym/_emerge/AsynchronousTask.py", line 30, in start
    self._start()
  File "/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 60, in _start  
    super(MergeProcess, self)._start()
  File "/usr/lib/portage/pym/_emerge/SpawnProcess.py", line 106, in _start
    retval = self._spawn(self.args, **kwargs)
  File "/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 153, in _spawn 
    self._lock_vdb()
  File "/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 70, in _lock_vdb
    self.vartree.dbapi.lock()
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 222, in lock
    self._lock = lockdir(self._dbroot)
  File "/usr/lib/portage/pym/portage/locks.py", line 53, in lockdir
    return lockfile(mydir, wantnewlockfile=1, flags=flags)
  File "/usr/lib/portage/pym/portage/locks.py", line 176, in lockfile
    locking_method(myfd, fcntl.LOCK_EX)
IOError: [Errno 4] Interrupted system call
[1]+  Exit 1                  emerge hdparm -1avu --jobs 2
root@lemote 0:130 ~ #
Comment 1 Zac Medico gentoo-dev 2015-01-31 20:28:42 UTC
I have a patch in the following branch:

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

I've posted it for review here:

	http://thread.gmane.org/gmane.linux.gentoo.portage.devel/5182
Comment 2 Zac Medico gentoo-dev 2015-01-31 23:14:08 UTC
This is in the master branch now:

https://github.com/gentoo/portage/commit/664684f0f17c0f3570ffd9382037994db1ec66bd
Comment 3 Brian Dolbec gentoo-dev 2015-02-12 06:08:37 UTC
Released in portage-2.2.16