Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 528176 - Enhance emerge to show that it is waiting for a directory lock for /var/tmp/portage instead of printing nothing.
Summary: Enhance emerge to show that it is waiting for a directory lock for /var/tmp/p...
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Low enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-03 21:05 UTC by Alex Cannon
Modified: 2014-11-04 03:23 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 Alex Cannon 2014-11-03 21:05:22 UTC
When I emerge util-linux, emerge just hangs using 0% CPU. Pressing Ctrl+C makes it print the traceback.

# emerge -av util-linux

 * IMPORTANT: 2 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.


These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] sys-apps/util-linux-2.24.1-r3 [2.22.2] USE="bash-completion%* caps%* cramfs fdformat%* ncurses nls pam%* python%* suid unicode -cytune% (-selinux) -slang -static-libs {-test} -tty-helpers% -udev (-crypt%*) (-ddate%) (-old-linux%) (-perl%)" PYTHON_SINGLE_TARGET="python2_7%* (-python3_2) -python3_3% (-python3_4)" PYTHON_TARGETS="python2_7%* python3_3%* (-python3_2) (-python3_4)" 3,461 kB

Total: 1 package (1 upgrade), Size of downloads: 3,461 kB

!!! The following installed packages are masked:
- net-im/qutim-0.3.1::gentoo (masked by: package.mask)
/usr/portage/profiles/package.mask:
# Davide Pesavento <pesa@gentoo.org> (20 Oct 2014)
# Does not build with any in-tree version of cmake since 20140713 (bug 506614).
# Jabber plugin is broken (bug 464690). Masked for removal in 30 days.

For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.


Would you like to merge these packages? [Yes/No]

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) sys-apps/util-linux-2.24.1-r3
^C

Exiting on signal 2
Traceback (most recent call last):
  File "/usr/lib/portage/bin/lock-helper.py", line 29, in <module>
    rval = main(sys.argv[1:])
  File "/usr/lib/portage/bin/lock-helper.py", line 21, in main
    lock_obj = portage.locks.lockfile(args[0], wantnewlockfile=True)
  File "/usr/lib/portage/pym/portage/locks.py", line 175, in lockfile
    locking_method(myfd, fcntl.LOCK_EX)
KeyboardInterrupt
_LockProcess: failed to acquire lock on '/var/tmp/portage/sys-apps/util-linux-2.24.1-r3'
Traceback (most recent call last):
  File "/usr/bin/emerge", line 50, in <module>
    retval = emerge_main()
  File "/usr/lib/portage/pym/_emerge/main.py", line 1031, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib/portage/pym/_emerge/actions.py", line 4062, in run_action
    emerge_config.args, spinner)
  File "/usr/lib/portage/pym/_emerge/actions.py", line 453, in action_build
    retval = mergetask.merge()
  File "/usr/lib/portage/pym/_emerge/Scheduler.py", line 1019, in merge
    rval = self._merge()
  File "/usr/lib/portage/pym/_emerge/Scheduler.py", line 1408, in _merge
    self._main_loop()
  File "/usr/lib/portage/pym/_emerge/Scheduler.py", line 1375, in _main_loop
    self._schedule()
  File "/usr/lib/portage/pym/_emerge/PollScheduler.py", line 127, in _schedule
    self._schedule_tasks()
  File "/usr/lib/portage/pym/_emerge/Scheduler.py", line 1576, in _schedule_tasks
    if self._schedule_tasks_imp():
  File "/usr/lib/portage/pym/_emerge/Scheduler.py", line 1706, in _schedule_tasks_imp
    self._task_queues.jobs.add(task)
  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/MergeListItem.py", line 93, in _start
    self._start_task(build, 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/EbuildBuild.py", line 91, in _start
    self._prefetch_exit(prefetcher)
  File "/usr/lib/portage/pym/_emerge/EbuildBuild.py", line 147, in _prefetch_exit
    self._build_dir.lock()
  File "/usr/lib/portage/pym/_emerge/EbuildBuildDir.py", line 60, in lock
    self._assert_lock(builddir_lock)
  File "/usr/lib/portage/pym/_emerge/EbuildBuildDir.py", line 71, in _assert_lock
    % (async_lock.returncode,))
AssertionError: AsynchronousLock failed with returncode 1


Reproducible: Always




# emerge --info
Portage 2.2.8-r2 (default/linux/x86/13.0, gcc-4.5.4, glibc-2.19-r1, 3.0.76-gentoo i686)
=================================================================
System uname: Linux-3.0.76-gentoo-i686-Pentium_III_-Coppermine-with-gentoo-2.2
KiB Mem:     1031368 total,     55280 free
KiB Swap:    4745336 total,   4420848 free
Timestamp of tree: Fri, 24 Oct 2014 12:30:01 +0000
ld GNU ld (Gentoo 2.23.2 p1.0) 2.23.2
app-shells/bash:          4.2_p53
dev-java/java-config:     2.2.0
dev-lang/perl:            5.18.2-r2
dev-lang/python:          2.6.8-r1, 2.7.7, 3.1.5-r1, 3.2.5-r3, 3.3.5-r1, 3.4.1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            3.4.6-r2, 4.3.6-r1, 4.5.4
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA Oracle-BCLA-JavaSE IBM-J1.6"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=pentium3 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-Os -march=pentium3 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
USE="7zip X a52 aac acc acl alsa apache2 bash-completion berkdb bittorrent bzip2 caps chappa cli cracklib crypt cups cxx dbus dga divx4linux dri dvd dvdread emacs encode esd esound extras faad fdformat ffmpeg finger fltk fontconfig fortran ftp gd gdbm gif gimp gnutella gopher gpm gtk html hwdb iconv idn imagemagick imap imlib ipv6 jadetex javascript jpeg kdeenablefinal live mad mbox mmx mmxext mng modules motif mp2 mp3 mpeg mpi multinet ncurses nls nntp nptl offensive ogg oident openft openmp pam pcre perl png pnm pop proxy_http python qt3support readline scripting session sidebar snmp socks5 speex sse ssl suexec syslog tcl tcpd theora tiff tk truetype unicode usb vim-syntax vorbis webkit x264 x86 xa xinetd xv xvid zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias ident proxy proxy_connect proxy_ftp proxy_http" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 1 Zac Medico gentoo-dev 2014-11-03 21:34:27 UTC
It seems as though you have a hung process holding a lock on sys-apps/util-linux-2.24.1-r3 build directory in PORTAGE_TMPDIR. You should search for the hung process and kill it. You can use 'lsof | grep /var/tmp/portage' to locate the hung process.

If you can't find a process with lsof, then it could be a stale "hardlink" lock that you you can clean up with this command:

	/usr/lib/portage/bin/clean_locks /var/tmp/portage/sys-apps

However, clean_locks is only relevant if the file system mounted on /var/tmp/portage does not support "regular" file locks.
Comment 2 Alex Cannon 2014-11-04 03:23:32 UTC
Thanks! It turns out that all it was was a suspended instance of emerge which I completely lost track of.

It would be nice if emerge showed that it was waiting for a lock to clear. I remember other instances where it has said that it is waiting for a lock on the portage database or such. I changed the bug to be an enhancement.