Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 907250 - dev-build/cmake-3.26.4-r1: cmake hangs forever whenever I run it on loong in io_uring_setup with dev-libs/libuv-1.45.0
Summary: dev-build/cmake-3.26.4-r1: cmake hangs forever whenever I run it on loong in ...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Loong Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-27 14:32 UTC by Justin Yang
Modified: 2024-01-14 19:55 UTC (History)
3 users (show)

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 Justin Yang 2023-05-27 14:32:21 UTC
I use a 3A5000 Loong machine with Gentoo Linux installed, all the things except kernel are built from our portage. Now recently, whenever I run cmake, even without any arguments to see help message, it just hangs there, and the process of cmake becomes a zombie. I also tried to see what get in the way by using strace:

---
$ strace cmake
...skip...
write(1, "re-generate its build system.\n", 30re-generate its build system.
) = 30
write(1, "\n", 1
)                       = 1
write(1, "Run 'cmake --help' for more info"..., 41Run 'cmake --help' for more information.
) = 41
write(1, "\n", 1
)                       = 1
clock_gettime(CLOCK_MONOTONIC, {tv_sec=824, tv_nsec=65730111}) = 0
epoll_create1(EPOLL_CLOEXEC)            = 3
io_uring_setup(64, {flags=IORING_SETUP_SQPOLL, sq_thread_cpu=0, sq_thread_idle=10 <unfinished ...>) = ?

---

and it stops here.

Reproducible: Always

Steps to Reproduce:
1. Just type 'cmake' on terminal on Loong machine.
Actual Results:  
It hangs there.

Expected Results:  
It should print help message and exit as normal.

1. Computer: Loongarch 3A5000
2. emerge --info:
ed-usr, gcc-13, glibc-2.37-r3, 5.16.0-rc6+ loongarch64)
=================================================================
System uname: Linux-5.16.0-rc6+-loongarch64-with-glibc2.37
KiB Mem:     8232544 total,   4373696 free
KiB Swap:    8388560 total,   8388560 free
Timestamp of repository gentoo: Sat, 27 May 2023 09:15:01 +0000
Head commit of repository gentoo: bc51175c3209c76263fdad454ffc2cd2d363bc7c
Timestamp of repository guru: Sat, 27 May 2023 12:31:51 +0000
Head commit of repository guru: b436ee84bf59ec30ac9fcb5d428e9e51f044d8d2

sh bash 5.2_p15-r2
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r2::gentoo
dev-lang/perl:             5.36.1-r2::gentoo
dev-lang/python:           3.11.3::gentoo, 3.12.0_beta1::gentoo
dev-util/cmake:            3.26.4-r1::gentoo
dev-util/meson:            1.1.0::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/sandbox:          2.30-r1::gentoo
sys-apps/systemd:          253.4::gentoo
sys-devel/autoconf:        2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/gcc:             13.1.1_p20230520::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/llvm:            16.0.4::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://mirrors.tuna.tsinghua.edu.cn/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    volatile: False

ACCEPT_KEYWORDS="loong ~loong ~riscv"
ACCEPT_LICENSE="*"
CBUILD="loongarch64-unknown-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="loongarch64-unknown-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"
CXXFLAGS="-O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
PKGDIR="/var/cache/binpkgs"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/usr/bin/fish"
USE="X acl bzip2 cli crypt dri fortran gdbm iconv ipv6 loong ncurses nls nptl openmp pam pcre readline seccomp ssl systemd udev unicode xattr zlib" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby30" VIDEO_CARDS="dummy fbdev v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-27 14:34:52 UTC
Can you try downgrade libuv? It recently started to use io_uring.
Comment 2 Justin Yang 2023-05-27 14:56:32 UTC
(In reply to Sam James from comment #1)
> Can you try downgrade libuv? It recently started to use io_uring.

Thanks! Downgrading libuv to 1.44.2-r1 fix the issue. I still couldn't get what's wrong with io_uring on my system...
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-27 14:59:10 UTC
No problem :)

It's likely a kernel bug. Could you try running the test suite for new libuv (emerge -v1 --with-test-deps libuv; FEATURES=test emerge -v1 libuv)?

That should help us find a smaller reproducer.
Comment 4 Justin Yang 2023-05-27 16:11:39 UTC
(In reply to Sam James from comment #3)
> No problem :)
> 
> It's likely a kernel bug. Could you try running the test suite for new libuv
> (emerge -v1 --with-test-deps libuv; FEATURES=test emerge -v1 libuv)?
> 
> That should help us find a smaller reproducer.

The output seems to be quite large:) I waited there and soon found that it stopped at "make check-TESTS" and never proceeded. 

---
...skip...
make[1]: Leaving directory '/var/tmp/portage/dev-libs/libuv-1.45.0/work/libuv-1.45.0'
make  check-TESTS

---

And quite similar to my cmake issue described aforementationed, the "run-tests" process becomes a zombile too...

$ ps auxww | grep run-test
portage    23611  0.0  0.0   7984  4224 pts/0    S+   00:04   0:00 /bin/sh -c failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=.; export srcdir; \ list=' test/run-tests '; \ { mgn= red= grn= lgn= blu= brg= std=; am__color_tests=no; if test "X" = Xno; then am__color_tests=no; elif test "X" = Xalways; then am__color_tests=yes; elif test "X$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then am__color_tests=yes; fi; if test $am__color_tests = yes; then red='?[0;31m'; grn='?[0;32m'; lgn='?[1;32m'; blu='?[1;34m'; mgn='?[0;35m'; brg='?[1m'; std='?[m'; fi; }; \ if test -n "$list"; then \   for tst in $list; do \     if test -f ./$tst; then dir=./; \     elif test -f $tst; then dir=; \     else dir="./"; fi; \     if  ${dir}$tst ; then \       all=`expr $all + 1`; \       case "  " in \       *[\ \?]$tst[\ \?]*) \ ?xpass=`expr $xpass + 1`; \ ?failed=`expr $failed + 1`; \ ?col=$red; res=XPASS; \       ;; \       *) \ ?col=$grn; res=PASS; \       ;; \       esac; \     elif test $? -ne 77; then \       all=`expr $all + 1`; \       case "  " in \       *[\ \?]$tst[\ \?]*) \ ?xfail=`expr $xfail + 1`; \ ?col=$lgn; res=XFAIL; \       ;; \       *) \ ?failed=`expr $failed + 1`; \ ?col=$red; res=FAIL; \       ;; \       esac; \     else \       skip=`expr $skip + 1`; \       col=$blu; res=SKIP; \     fi; \     echo "${col}$res${std}: $tst"; \   done; \   if test "$all" -eq 1; then \     tests="test"; \     All=""; \   else \     tests="tests"; \     All="All "; \   fi; \   if test "$failed" -eq 0; then \     if test "$xfail" -eq 0; then \       banner="$All$all $tests passed"; \     else \       if test "$xfail" -eq 1; then failures=failure; else failures=failures; fi; \       banner="$All$all $tests behaved as expected ($xfail expected $failures)"; \     fi; \   else \     if test "$xpass" -eq 0; then \       banner="$failed of $all $tests failed"; \     else \       if test "$xpass" -eq 1; then passes=pass; else passes=passes; fi; \       banner="$failed of $all $tests did not behave as expected ($xpass unexpected $passes)"; \     fi; \   fi; \   dashes="$banner"; \   skipped=""; \   if test "$skip" -ne 0; then \     if test "$skip" -eq 1; then \       skipped="($skip test was not run)"; \     else \       skipped="($skip tests were not run)"; \     fi; \     test `echo "$skipped" | wc -c` -le `echo "$banner" | wc -c` || \       dashes="$skipped"; \   fi; \   report=""; \   if test "$failed" -ne 0 && test -n "https://github.com/libuv/libuv/issues"; then \     report="Please report to https://github.com/libuv/libuv/issues"; \     test `echo "$report" | wc -c` -le `echo "$banner" | wc -c` || \       dashes="$report"; \   fi; \   dashes=`echo "$dashes" | sed s/./=/g`; \   if test "$failed" -eq 0; then \     col="$grn"; \   else \     col="$red"; \   fi; \   echo "${col}$dashes${std}"; \   echo "${col}$banner${std}"; \   test -z "$skipped" || echo "${col}$skipped${std}"; \   test -z "$report" || echo "${col}$report${std}"; \   echo "${col}$dashes${std}"; \   test "$failed" -eq 0; \ else :; fi
portage    23612  0.0  0.0  19744  2992 pts/0    Sl+  00:04   0:00 /var/tmp/portage/dev-libs/libuv-1.45.0/work/libuv-1.45.0/test/.libs/run-tests
portage    23628 99.9  0.0      0     0 pts/0    Zl+  00:04   2:50 [run-tests] <defunct>
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-28 14:52:39 UTC
At this point, I think it's beyond me, and I need either xen0n to help you debug it, or for you to report it to io-uring upstream (who are very nice).

I'd maybe do the latter now and see what they say?
Comment 6 Justin Yang 2023-05-28 15:05:14 UTC
(In reply to Sam James from comment #5)
> At this point, I think it's beyond me, and I need either xen0n to help you
> debug it, or for you to report it to io-uring upstream (who are very nice).
> 
> I'd maybe do the latter now and see what they say?

OK, thanks! If they need more information, just tell me.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-01 08:07:45 UTC
(In reply to Justin Yang from comment #6)
> (In reply to Sam James from comment #5)
> > At this point, I think it's beyond me, and I need either xen0n to help you
> > debug it, or for you to report it to io-uring upstream (who are very nice).
> > 
> > I'd maybe do the latter now and see what they say?
> 
> OK, thanks! If they need more information, just tell me.

Sorry for being unclear! I was suggesting you report it. I could do it, but I don't really have the ability to give any more information so I'd just be a middleman. Apologies!
Comment 8 WANG Xuerui gentoo-dev 2023-06-03 07:48:13 UTC
Hi!

I have tried to reproduce the problem locally but couldn't. I also have cmake 3.26.4-r1 and libuv 1.45.0 but I run the latest kernel; it seems you have very ancient kernel version (even predating the upstream inclusion!!!) so that may very likely be the reason.

Please upgrade your kernel to e.g. the 6.1.x series, or better, one of the latest 6.3.x, and see if the problem persists. Thanks!
Comment 9 Justin Yang 2023-06-03 16:55:24 UTC
Thanks. I think it's quite likely related to kernel problem, and I might try to upgrade my ancient kernel in the near future.