Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 390257

Summary: Race condition in emerge when aborting
Product: Portage Development Reporter: Richard <shiningarcanine>
Component: CoreAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Richard 2011-11-12 13:52:04 UTC
There appears to be a race condition in emerge --depclean where if you press Ctrl+C very early, it will not exit and all attempts to kill the process via Ctrl+C or even "killall emerge" will be ignored:

# emerge --depclean
^C

Exiting on signal 2
Exception SystemExit: 130 in <function remove at 0x7f4f01c1cf50> ignored
^[[A ^C
 * Depclean may break link level dependencies. Thus, it is
 * recommended to use a tool such as `revdep-rebuild` (from
 * app-portage/gentoolkit) in order to detect such breakage.
 * 
 * Always study the list of packages to be cleaned for any obvious
 * mistakes. Packages that are part of the world set will always
 * be kept.  They can be manually added to this set with
 * `emerge --noreplace <atom>`.  Packages that are listed in
 * package.provided (see portage(5)) will be removed by
 * depclean, even if they are part of the world set.
 * 
 * As a safety measure, depclean will not remove any packages
 * unless *all* required dependencies have been resolved.  As a
 * consequence, it is often necessary to run `emerge --update
 * --newuse --deep @world` prior to depclean.

Calculating dependencies   - \ - /^C -^C -^C |^C \^C /^C /^C - \ / - /^[ - /^C \ |^C /^C^C^C^C^C^C | /                                                                                                                                                                        \ - \ | | -... done!
>>> Calculating removal order...

I found this when I realized that I had forgotten to append "--ask" as I pressed the enter key.
Comment 1 Michael Weber (RETIRED) gentoo-dev 2011-11-12 14:16:33 UTC
unreleated general hint: use Ctrl-Z (SIGSTOP) esp. in script situations.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2011-11-12 15:27:34 UTC
This doesn't just happen with depclean.
Comment 3 Zac Medico gentoo-dev 2011-11-12 15:57:31 UTC
I've seen that before. It seems like the python runtime is suppressing our SystemExit exception somewhere, because we don't have any code in portage that suppresses SystemExit.