Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 653844 - sys-apps/portage: EbuildBuild._start() event loop recursion
Summary: sys-apps/portage: EbuildBuild._start() event loop recursion
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 648790
Blocks: 591760
  Show dependency tree
 
Reported: 2018-04-22 23:13 UTC by Zac Medico
Modified: 2018-09-24 02:50 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 Zac Medico gentoo-dev 2018-04-22 23:13:25 UTC
Event loop recursion occurs in EbuildBuild._start() when it calls doebuild_environment which calls aux_get for SRC_URI here:

> 		if hasattr(mydbapi, "getFetchMap") and \
> 			("A" not in mysettings.configdict["pkg"] or \
> 			"AA" not in mysettings.configdict["pkg"]):
> 			src_uri, = mydbapi.aux_get(mysettings.mycpv,
> 				["SRC_URI"], mytree=mytree)

> Traceback (most recent call last):
>   File "bin/emerge", line 51, in <module>
>     retval = emerge_main()
>   File "pym/_emerge/main.py", line 1282, in emerge_main
>     return run_action(emerge_config)
>   File "pym/_emerge/actions.py", line 3316, in run_action
>     retval = action_build(emerge_config, spinner=spinner)
>   File "pym/_emerge/actions.py", line 541, in action_build
>     retval = mergetask.merge()
>   File "pym/_emerge/Scheduler.py", line 1004, in merge
>     rval = self._merge()
>   File "pym/_emerge/Scheduler.py", line 1409, in _merge
>     self._main_loop()
>   File "pym/_emerge/Scheduler.py", line 1381, in _main_loop
>     self._event_loop.iteration()
>   File "pym/portage/util/_eventloop/EventLoop.py", line 281, in iteration
>     return self._iteration(*args)
>   File "pym/portage/util/_eventloop/EventLoop.py", line 302, in _iteration
>     if self._run_timeouts():
>   File "pym/portage/util/_eventloop/EventLoop.py", line 597, in _run_timeouts
>     if self._run_idle_callbacks():
>   File "pym/portage/util/_eventloop/EventLoop.py", line 556, in _run_idle_callbacks
>     if x._callback(*x._args):
>   File "pym/_emerge/AsynchronousTask.py", line 74, in _async_wait_cb
>     self.wait()
>   File "pym/_emerge/AsynchronousTask.py", line 57, in wait
>     self._wait_hook()
>   File "pym/_emerge/AsynchronousTask.py", line 175, in _wait_hook
>     self._exit_listener_stack.pop()(self)
>   File "pym/_emerge/EbuildMerge.py", line 59, in _merge_exit
>     self.wait()
>   File "pym/_emerge/AsynchronousTask.py", line 57, in wait
>     self._wait_hook()
>   File "pym/_emerge/AsynchronousTask.py", line 175, in _wait_hook
>     self._exit_listener_stack.pop()(self)
>   File "pym/_emerge/PackageMerge.py", line 49, in _install_exit
>     self.wait()
>   File "pym/_emerge/AsynchronousTask.py", line 57, in wait
>     self._wait_hook()
>   File "pym/_emerge/AsynchronousTask.py", line 175, in _wait_hook
>     self._exit_listener_stack.pop()(self)
>   File "pym/_emerge/Scheduler.py", line 1258, in _merge_exit
>     self._schedule()
>   File "pym/_emerge/PollScheduler.py", line 154, in _schedule
>     self._schedule_tasks()
>   File "pym/_emerge/Scheduler.py", line 1577, in _schedule_tasks
>     if self._schedule_tasks_imp():
>   File "pym/_emerge/Scheduler.py", line 1707, in _schedule_tasks_imp
>     self._task_queues.jobs.add(task)
>   File "pym/_emerge/SequentialTaskQueue.py", line 23, in add
>     self.schedule()
>   File "pym/_emerge/SequentialTaskQueue.py", line 45, in schedule
>     task.start()
>   File "pym/_emerge/AsynchronousTask.py", line 30, in start
>     self._start()
>   File "pym/_emerge/MergeListItem.py", line 85, in _start
>     self._start_task(build, self._default_final_exit)
>   File "pym/_emerge/CompositeTask.py", line 156, in _start_task
>     task.start()
>   File "pym/_emerge/AsynchronousTask.py", line 30, in start
>     self._start()
>   File "pym/_emerge/EbuildBuild.py", line 65, in _start
>     settings=self.settings, db=portdb)
>   File "pym/portage/package/ebuild/doebuild.py", line 454, in doebuild_environment
>     ["SRC_URI"], mytree=mytree)
>   File "pym/portage/dbapi/porttree.py", line 587, in aux_get
>     myrepo=myrepo, loop=loop))
>   File "pym/portage/util/_eventloop/EventLoop.py", line 827, in run_until_complete
>     self.iteration()
Comment 1 Larry the Git Cow gentoo-dev 2018-04-23 00:08:50 UTC
The bug has been referenced in the following commit(s):

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

commit db4dca876cdb004b12a944f5323a51bc4bbde770
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-04-23 00:04:29 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-04-23 00:06:35 +0000

    EbuildBuild._start(): fix event loop recursion (bug 653844)
    
    Use async_aux_get to fetch SRC_URI metadata (it's not cached in
    self.pkg.metadata because some packages have an extremely large
    SRC_URI value).
    
    Bug: https://bugs.gentoo.org/653844

 pym/_emerge/EbuildBuild.py             | 19 ++++++++++++++-----
 pym/portage/package/ebuild/doebuild.py |  6 ++++--
 2 files changed, 18 insertions(+), 7 deletions(-)}
Comment 2 Zac Medico gentoo-dev 2018-09-24 02:50:00 UTC
Fixed in portage-2.3.32.