Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 193979 - revdep-rebuild in app-portage/gentoolkit-0.2.4* slow clean_var() hangs at configuring search environment
Summary: revdep-rebuild in app-portage/gentoolkit-0.2.4* slow clean_var() hangs at con...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
: 209958 210101 (view as bug list)
Depends on:
Blocks: 170220 177925
  Show dependency tree
 
Reported: 2007-09-27 11:12 UTC by Togge
Modified: 2008-02-21 01:52 UTC (History)
4 users (show)

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


Attachments
revdep-rebuild-awkCleanVars-r448.patch (revdep-rebuild-awkCleanVars-r448.patch,1.19 KB, patch)
2007-09-27 13:35 UTC, michael@smith-li.com
Details | Diff
revdep-rebuild-awkCleanVars-r448.patch (revdep-rebuild-awkCleanVars-r448.patch,1.22 KB, patch)
2007-09-27 17:49 UTC, michael@smith-li.com
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Togge 2007-09-27 11:12:33 UTC
When running revdep-rebuild from app-portage/gentoolkit-0.2.4-rc1, the progress is halted when clean_vars() is called in a subshell. CPU usage goes to 100% and stays there until the subshell is killed, it does not exit when the main program is interuppted.

The line that triggers this is:
a="${a//+(\/\/)//}"


app-shells/bash-3.2_p17-r1 is used

Reproducible: Always

Steps to Reproduce:
Comment 1 Togge 2007-09-27 11:25:01 UTC
This line also triggers the "hang"
a="${a//+([[:space:]])/$'\n'}"
Comment 2 Togge 2007-09-27 13:13:55 UTC
After more investigation the part about it hanging was wrong.

The problem is that the line that handle spaces -> "\n" scale very poorly, something like O(nĀ²) where n is the number of characters in the string.
Comment 3 michael@smith-li.com 2007-09-27 13:35:36 UTC
Created attachment 132023 [details, diff]
revdep-rebuild-awkCleanVars-r448.patch

<sigh> I don't seem to be able to avoid using external commands for this clean_vars(). This patch should fix the problem. Thanks to togge_ on #gentoo-dev-help for helping me re-benchmark extglob.
Comment 4 Paul Varner (RETIRED) gentoo-dev 2007-09-27 15:40:56 UTC
gentoolkit-0.2.4_rc1 has been package masked due to this and other significant problems.  Please downgrade back to gentoolkit-0.2.4_pre7
Comment 5 michael@smith-li.com 2007-09-27 17:49:02 UTC
Created attachment 132034 [details, diff]
revdep-rebuild-awkCleanVars-r448.patch

Same deal as my comment #3, only not broken (I typoed the regex the first time through.)
Comment 6 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2007-12-17 14:23:53 UTC
(In reply to comment #4)
> gentoolkit-0.2.4_rc1 has been package masked due to this and other significant
> problems.  Please downgrade back to gentoolkit-0.2.4_pre7
 
I've noticed this in 0.2.4_pre7 too, when working on bug 177925. 8-10 control files setting SEARCH_DIRS_MASK and the "configuring search environment" will take ages with 100% CPU eaten (and even ctrl+c leaves that process crunching on background). Also traced it down to clean_var(), didn't check which part of it exactly... Thus I'm updating bug's name.
Comment 7 Tobias Klausmann (RETIRED) gentoo-dev 2008-01-13 18:22:32 UTC
I've looked into this too. At a certain point, clear_vars is fed a variable which is about 22000 chars (!) long. Most of the entries are dupes from /usr/kde/3.5/lib and similar paths (from KDE). While the performance problem is fixed (in a way) by using sed, I feel that generating said var might be optimized. I don't really know how revdep-rebuild arrives at that monster of a path list, so I might be wrong on that part.

Comment 8 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2008-02-13 08:35:01 UTC
*** Bug 209958 has been marked as a duplicate of this bug. ***
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2008-02-14 09:35:11 UTC
*** Bug 210101 has been marked as a duplicate of this bug. ***
Comment 10 Paul Varner (RETIRED) gentoo-dev 2008-02-21 01:52:07 UTC
Released in gentoolkit-0.2.4_rc2