Summary: | portage goes into endless loop when trying to emerge some packages | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Piergiorgio Beruto <pberuto> |
Component: | [OLD] Core system | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | Keywords: | InVCS |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=555698 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 373933 | ||
Attachments: |
debug log
output circular dependency debug graph earlier new debug log fix exponential loop triggered by REQUIRED_USE in php ebuild |
Description
Piergiorgio Beruto
2011-07-07 22:22:44 UTC
When it's hung like that, you can Pdb to get a backtrace like this: 1) kill -s SIGUSR1 <emerge pid> 2) the signal should make emerge should go to a Pdb prompt, then you can use the 'bt' command to make it display a backtrace here is the output of the backtrace from "emerge --pretend syslog-ng:" These are the packages that would be merged, in order: Calculating dependencies ... done! --Return-- > /usr/bin/emerge(28)debug_signal()->None -> pdb.set_trace() (Pdb) /usr/bin/emerge(43)<module>() -> retval = emerge_main() /usr/lib64/portage/pym/_emerge/main.py(1907)emerge_main() -> myopts, myaction, myfiles, spinner) /usr/lib64/portage/pym/_emerge/actions.py(302)action_build() -> mydepgraph.display_problems() /usr/lib64/portage/pym/_emerge/depgraph.py(6013)display_problems() -> self._display_problems() /usr/lib64/portage/pym/_emerge/depgraph.py(6026)_display_problems() -> self._dynamic_config._circular_deps_for_display) /usr/lib64/portage/pym/_emerge/depgraph.py(5485)_show_circular_deps() -> circular_dependency_handler(self, mygraph) /usr/lib64/portage/pym/_emerge/resolver/circular_dependency.py(28)__init__() -> self.solutions, self.suggestions = self._find_suggestions() /usr/lib64/portage/pym/_emerge/resolver/circular_dependency.py(179)_find_suggestions() -> uselist=current_use, flat=True) /usr/lib64/portage/pym/portage/dep/__init__.py(400)use_reduce() -> if is_active(stack[level][-1]): /usr/lib64/portage/pym/portage/dep/__init__.py(311)is_active() -> if conditional.startswith("!"): > /usr/bin/emerge(28)debug_signal()->None -> pdb.set_trace() (Pdb) It seems to me that it found some circular deps but it goes into an endless loop and fails to show the result... I've reviewed the code for this loop. It's hard to read, but it seems like it's guaranteed to terminate. It might take a long time if you have a large cycle involving lots of USE flags though. Maybe it will eventually complete if you let it run a bit longer. I've copied the _next_use_state code into a separate file and it seems to work as intended. We can get the same result with python's cartesian product function: itertools.product(("enabled", "disabled"), repeat=len(affecting_use)) Hi, I've been running "emerge --pretend syslog-ng" for more than 45 minutes (@core i7 950) with still no results... I didn't understand your last comment, is there anything I shall do to help you debug this issue? Please attach a log created like this: emerge --pretend --debug syslog-ng &> debug.log You can run `tail -f debug.log` from another shell, and kill it when it appears to get stuck in a loop. Created attachment 279539 [details]
debug log
Here you are,
I've waited for some minutes before actually stopping the command.
The wierd thing is that nothing is printed after "done".
I can upload the (partially installed) virtualbox image if you wish.
Created attachment 279549 [details, diff] output circular dependency debug graph earlier Save as /tmp/circ_debug.patch and apply as follows: cd /usr/lib/portage patch -p1 < /tmp/circ_debug.patch Please apply this patch and then create a new log as described in comment #6. This will give us more info about the nature of the cycle that we are dealing with. Created attachment 279551 [details]
new debug log
here you are,
hope this helps!
Created attachment 279557 [details, diff]
fix exponential loop triggered by REQUIRED_USE in php ebuild
Save as /tmp/circ_fix.patch and apply as follows:
patch /usr/lib/portage/pym/_emerge/resolver/circular_dependency.py /tmp/circ_fix.patch
Ok, that seems to work in both my virtual machines. Thank you for your assistance. Thanks for testing. This is fixed in 2.1.10.5 and 2.2.0_alpha44. |