I noticed that nodejs was hanging after stripping. floppym did some further investigation and he found it hangs at check_dyn_libs_inconsistent's call to glob.glob(). I get strace output like: openat(AT_FDCWD, "/var/tmp/portage/net-libs/nodejs-16.10.0/image/usr/include/node/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/v8/include/deps/uv/include/src/src/deps/v8/include/deps/uv/include/deps/v8/include/deps/uv/include/src/deps/uv/include/deps/v8", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 7 Interestingly, it keeps going even once it gets ELOOP. glob.glob() seems to always follow symlinks. There's a bug/feature request for Python to not do this: https://bugs.python.org/issue29475 which doesn't seem to have gone far. The issue itself is caused by nodejs's self-referential symlink at /usr/include/node/src: lrwxrwxrwx 1 root root 1 Oct 25 16:00 /usr/include/node/src -> . We need to adapt/replace the glob.glob() code in check_dyn_libs_inconsistent() with something that doesn't follow symlinks.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=3b3503bb2769b390e22a4fea42fa56fe4db4ddec commit 3b3503bb2769b390e22a4fea42fa56fe4db4ddec Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2021-11-23 22:39:24 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2021-11-23 23:22:32 +0000 portage/util/_dyn_libs/dyn_libs.py: fix symlink recursion issue Python's glob.glob() function follows symlinks recursively. Use os.walk() instead. Also re-order the operands to short-circuit the directory walk when PROVIDES is not empty. Bug: https://bugs.gentoo.org/826982 Fixes: cba2156dba89a22f2858238013469b4d80208854 Signed-off-by: Mike Gilbert <floppym@gentoo.org> lib/portage/util/_dyn_libs/dyn_libs.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
Should be fixed in 3.0.29.