Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 339670 - dev-vcs/mercurial-1.6.4 fails due to, "Too many levels of symbolic links"
Summary: dev-vcs/mercurial-1.6.4 fails due to, "Too many levels of symbolic links"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Krzysztof Pawlik (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 349307 350158
  Show dependency tree
 
Reported: 2010-10-04 03:43 UTC by Erik Zeek
Modified: 2010-12-30 20:30 UTC (History)
3 users (show)

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


Attachments
build log (dev-vcs:mercurial-1.6.4:20101004-032026.log,36.42 KB, text/plain)
2010-10-04 03:43 UTC, Erik Zeek
Details
emerge --info (emerge-info.txt,11.75 KB, text/plain)
2010-10-04 03:45 UTC, Erik Zeek
Details
patch for portage (recursive_permissions-don-t-follow-symlink.patch,2.46 KB, patch)
2010-12-14 04:01 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Zeek 2010-10-04 03:43:24 UTC
Updating to dev-vcs/mercurial-1.6.4 fails in testing due to:
OSError: [Errno 40] Too many levels of symbolic links: '/gentoo/tmp/portage/dev-vcs/mercurial-1.6.4/temp/tests-2.6/child3/test-mq-symlinks/linka'

The traceback below does not show up in the build log.

>>> Source compiled.
 * Testing of dev-vcs/mercurial-1.6.4 with CPython 2.6...
........................................s.............s..........................s..........................................................................................................................................................................................................s...................................................................................
Skipped test-convert-p4: missing feature: Perforce server and client
Skipped test-casefolding: missing feature: case insensitive file system
Skipped test-convert-p4-filetypes: missing feature: Perforce server and client
Skipped test-no-symlinks: system supports symbolic links
# Ran 368 tests, 4 skipped, 0 failed.
Traceback (most recent call last):
  File "/usr/bin/emerge", line 43, in <module>
    retval = emerge_main()
  File "/usr/lib64/portage/pym/_emerge/main.py", line 1683, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/lib64/portage/pym/_emerge/actions.py", line 441, in action_build
    retval = mergetask.merge()
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1085, in merge
    rval = self._merge()
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1403, in _merge
    self._main_loop()
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1552, in _main_loop
    self._poll_loop()
  File "/usr/lib64/portage/pym/_emerge/PollScheduler.py", line 138, in _poll_loop
    handler(f, event)
  File "/usr/lib64/portage/pym/_emerge/EbuildIpcDaemon.py", line 79, in _input_handler
    reply_hook()
  File "/usr/lib64/portage/pym/_emerge/AbstractEbuildProcess.py", line 149, in _exit_command_callback
    self.scheduler.schedule(self._reg_id, timeout=self._exit_timeout)
  File "/usr/lib64/portage/pym/_emerge/PollScheduler.py", line 232, in _schedule_wait
    handler(f, event)
  File "/usr/lib64/portage/pym/_emerge/SpawnProcess.py", line 203, in _output_handler
    self._unregister_if_appropriate(event)
  File "/usr/lib64/portage/pym/_emerge/AbstractPollTask.py", line 49, in _unregister_if_appropriate
    self.wait()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 41, in wait
    self._wait_hook()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 114, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib64/portage/pym/_emerge/EbuildPhase.py", line 142, in _ebuild_exit
    _post_phase_userpriv_perms(settings)
  File "/usr/lib64/portage/pym/portage/package/ebuild/doebuild.py", line 1189, in _post_phase_userpriv_perms
    filemode=0o60, filemask=0)
  File "/usr/lib64/portage/pym/portage/util/__init__.py", line 980, in apply_recursive_permissions
    uid=uid, gid=gid, mode=filemode, mask=filemask)
  File "/usr/lib64/portage/pym/portage/util/__init__.py", line 1005, in apply_secpass_permissions
    stat_cached = os.stat(filename)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 226, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
OSError: [Errno 40] Too many levels of symbolic links: '/gentoo/tmp/portage/dev-vcs/mercurial-1.6.4/temp/tests-2.6/child3/test-mq-symlinks/linka'
Comment 1 Erik Zeek 2010-10-04 03:43:56 UTC
Created attachment 249513 [details]
build log
Comment 2 Erik Zeek 2010-10-04 03:45:07 UTC
Created attachment 249514 [details]
emerge --info
Comment 3 Erik Zeek 2010-10-04 04:02:19 UTC
The contents of the failing directory:

sudo ls -l --color /gentoo/tmp/portage/dev-vcs/mercurial-1.6.4/temp/tests-2.6/child3/test-mq-symlinks/                                                                                                                          
total 12
-rw-rw-r-- 1 portage portage 4 Oct  3 21:27 b
-rw-r--r-- 1 portage portage 4 Oct  3 21:27 c
lrwxrwxrwx 1 portage portage 5 Oct  3 21:27 linka -> linka
lrwxrwxrwx 1 portage portage 6 Oct  3 21:27 linkb -> linkbb
-rw-rw-r-- 1 portage portage 4 Oct  3 21:27 s
Comment 4 Krzysztof Pawlik (RETIRED) gentoo-dev 2010-12-12 11:41:41 UTC
Please test mercurial >= 1.7.
Comment 5 Erik Zeek 2010-12-13 21:20:22 UTC
It's still there for me.

Looking at this again, it doesn't appear to be an error in mercurial, but, rather, an error in portage.  It looks like emerge is recursively descending into the test directory, hitting the recursive symlink, and crashing.

Perhaps this should be reassigned to portage.

Thanks,
Erik

emerge --version
Portage 2.2.0_alpha8 (default/linux/amd64/10.0/desktop/kde, gcc-4.5.1, glibc-2.12.1-r3, 2.6.36-gentoo-r3-fglrx x86_64)

<tail of build output>
>>> Source compiled.
 * Testing of dev-vcs/mercurial-1.7.2 with CPython 2.7...
..........................................s.......s..................................s..............s..........................................................................................................
..........................................s...........................................................................................................
Skipped test-casefolding.t: missing feature: case insensitive file system
Skipped test-convert-p4-filetypes: missing feature: Perforce server and client
Skipped test-no-symlinks: system supports symbolic links
Skipped test-check-code-hg.py: cannot check code on non-repository sources
Skipped test-convert-p4: missing feature: Perforce server and client
# Ran 376 tests, 5 skipped, 0 failed.
Traceback (most recent call last):
  File "/usr/bin/emerge", line 43, in <module>
    retval = emerge_main()
  File "/usr/lib64/portage/pym/_emerge/main.py", line 1700, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/lib64/portage/pym/_emerge/actions.py", line 443, in action_build
    retval = mergetask.merge()
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1160, in merge
    rval = self._merge()
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1478, in _merge
    self._main_loop()
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1620, in _main_loop
    self._poll_loop()
  File "/usr/lib64/portage/pym/_emerge/PollScheduler.py", line 138, in _poll_loop
    handler(f, event)
  File "/usr/lib64/portage/pym/_emerge/EbuildIpcDaemon.py", line 82, in _input_handler
    reply_hook()
  File "/usr/lib64/portage/pym/_emerge/AbstractEbuildProcess.py", line 149, in _exit_command_callback
    self.scheduler.schedule(self._reg_id, timeout=self._exit_timeout)
  File "/usr/lib64/portage/pym/_emerge/PollScheduler.py", line 232, in _schedule_wait
    handler(f, event)
  File "/usr/lib64/portage/pym/_emerge/SpawnProcess.py", line 203, in _output_handler
    self._unregister_if_appropriate(event)
  File "/usr/lib64/portage/pym/_emerge/AbstractPollTask.py", line 49, in _unregister_if_appropriate
    self.wait()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 41, in wait
    self._wait_hook()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 114, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib64/portage/pym/_emerge/EbuildPhase.py", line 148, in _ebuild_exit
    _post_phase_userpriv_perms(settings)
  File "/usr/lib64/portage/pym/portage/package/ebuild/doebuild.py", line 1207, in _post_phase_userpriv_perms
    filemode=0o60, filemask=0)
  File "/usr/lib64/portage/pym/portage/util/__init__.py", line 1018, in apply_recursive_permissions
    uid=uid, gid=gid, mode=filemode, mask=filemask)
  File "/usr/lib64/portage/pym/portage/util/__init__.py", line 1043, in apply_secpass_permissions
    stat_cached = os.stat(filename)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 226, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
OSError: [Errno 40] Too many levels of symbolic links: '/gentoo/tmp/portage/dev-vcs/mercurial-1.7.2/temp/tests-2.7/child0/test-mq-symlinks.t/linka'
Comment 6 Krzysztof Pawlik (RETIRED) gentoo-dev 2010-12-13 21:58:41 UTC
Zac: could you take a look at this build log?
Comment 7 Zac Medico gentoo-dev 2010-12-14 03:53:16 UTC
I've fixed portage to avoid the issue by using lstat instead of stat:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=31e8a00dae63f956cec892cecb016a511de122fc
Comment 8 Zac Medico gentoo-dev 2010-12-14 04:01:58 UTC
Created attachment 257086 [details, diff]
patch for portage
Comment 9 Erik Zeek 2010-12-14 05:01:23 UTC
(In reply to comment #8)
> Created an attachment (id=257086) [details]
> patch for portage
> 

That fixed it!

Thanks,
Erik
Comment 10 Zac Medico gentoo-dev 2010-12-16 17:11:53 UTC
(In reply to comment #9)
Thanks for testing. That patch is included in sys-apps/portage-2.2.0_alpha8.
Comment 11 Krzysztof Pawlik (RETIRED) gentoo-dev 2010-12-16 17:25:47 UTC
Awesome! Thanks Zac.
Comment 12 Zac Medico gentoo-dev 2010-12-21 18:58:47 UTC
This is fixed in portage-2.1.9.26.