[Bug 1207367] New: kwalletd5 takes a long time to start if fs.nr_open and the default nofiles limit is large
http://bugzilla.opensuse.org/show_bug.cgi?id=1207367 Bug ID: 1207367 Summary: kwalletd5 takes a long time to start if fs.nr_open and the default nofiles limit is large Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: x86-64 OS: openSUSE Tumbleweed Status: NEW Severity: Minor Priority: P5 - None Component: KDE Workspace (Plasma) Assignee: opensuse-kde-bugs@opensuse.org Reporter: gcj9exvx-opensuse@yahoo.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Created attachment 864298 --> http://bugzilla.opensuse.org/attachment.cgi?id=864298&action=edit Screenshot of systemmonitor and partial output of pstree showing busy kdeinit5 process To reproduce: - Use a standard Tumbleweed KDE setup with sddm login, KDE Wallet enabled and a wallet set up and automatically loaded on startup. - Set fs.nr_open to a somewhat large number than the default 1048576 like 1024*1024*128 (134217728). On very fast systems, go larger to get more time to observe. - Increase the default open files limit to the value of fs.nr_open. Setting it to unlimited will by default result in nofile getting set to equal fs.nr_open, so adding a file 99-nofile.conf to /etc/security/limits.d/99-nofile.conf with the contents ------------------- snip ----------------------------------------------- * soft nofile unlimited * hard nofile unlimited ------------------- snip ----------------------------------------------- will work. - Log out of KDE session and relogin through sddm - Observe a kdeinit5 process with high CPU activity. kwallet access is blocked while this process running, potentially blocking applications trying to access kwallet during this time (such as certain popular webbrowsers). Ref. attached screenshot for example. - Attach strace to pid of the kdeinit5 process mentioned above. Sample output right before the kdeinit5 process finally terminates after a couple of minutes. It looks like the process is somehow iterating over every single file descriptor available and only terminates afterwards. ------------------- snip ----------------------------------------------- close(134217696) = -1 EBADF (Bad file descriptor) close(134217697) = -1 EBADF (Bad file descriptor) close(134217698) = -1 EBADF (Bad file descriptor) close(134217699) = -1 EBADF (Bad file descriptor) close(134217700) = -1 EBADF (Bad file descriptor) close(134217701) = -1 EBADF (Bad file descriptor) close(134217702) = -1 EBADF (Bad file descriptor) close(134217703) = -1 EBADF (Bad file descriptor) close(134217704) = -1 EBADF (Bad file descriptor) close(134217705) = -1 EBADF (Bad file descriptor) close(134217706) = -1 EBADF (Bad file descriptor) close(134217707) = -1 EBADF (Bad file descriptor) close(134217708) = -1 EBADF (Bad file descriptor) close(134217709) = -1 EBADF (Bad file descriptor) close(134217710) = -1 EBADF (Bad file descriptor) close(134217711) = -1 EBADF (Bad file descriptor) close(134217712) = -1 EBADF (Bad file descriptor) close(134217713) = -1 EBADF (Bad file descriptor) close(134217714) = -1 EBADF (Bad file descriptor) close(134217715) = -1 EBADF (Bad file descriptor) close(134217716) = -1 EBADF (Bad file descriptor) close(134217717) = -1 EBADF (Bad file descriptor) close(134217718) = -1 EBADF (Bad file descriptor) close(134217719) = -1 EBADF (Bad file descriptor) close(134217720) = -1 EBADF (Bad file descriptor) close(134217721) = -1 EBADF (Bad file descriptor) close(134217722) = -1 EBADF (Bad file descriptor) close(134217723) = -1 EBADF (Bad file descriptor) close(134217724) = -1 EBADF (Bad file descriptor) close(134217725) = -1 EBADF (Bad file descriptor) close(134217726) = -1 EBADF (Bad file descriptor) close(134217727) = -1 EBADF (Bad file descriptor) dup2(2, 1) = 1 pipe2([3, 4], 0) = 0 rt_sigaction(SIGCHLD, {sa_handler=0x565343311560, sa_mask=[CHLD], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f38e82428e0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f38e89c8890) = 27299 close(4) = 0 read(3, "\0", 1) = 1 close(3) = 0 futex(0x7f38e89bd288, FUTEX_WAKE_PRIVATE, 2147483647) = 0 getpid() = 26212 exit_group(0) = ? +++ exited with 0 +++ ------------------- snip ----------------------------------------------- - Other interesting observations: User account that the kdeinit5 process is running under does NOT have raised nofile limits: ------------------- snip ----------------------------------------------- michael@beast:~> ulimit -a real-time non-blocking time (microseconds, -R) unlimited core file size (blocks, -c) unlimited data seg size (kbytes, -d) unlimited scheduling priority (-e) 30 file size (blocks, -f) unlimited pending signals (-i) 126667 max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 95 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 126667 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited ------------------- snip ----------------------------------------------- Only root does: ------------------- snip ----------------------------------------------- beast:~ # ulimit -a real-time non-blocking time (microseconds, -R) unlimited core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 126667 max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 134217728 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 126667 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited ------------------- snip ----------------------------------------------- -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1207367 Michael Nottebrock <gcj9exvx-opensuse@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P4 - Low -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1207367 Michael Nottebrock <gcj9exvx-opensuse@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gcj9exvx-opensuse@yahoo.com -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1207367 http://bugzilla.opensuse.org/show_bug.cgi?id=1207367#c1 Fabian Vogt <fabian@ritter-vogt.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fabian@ritter-vogt.de Flags| |needinfo?(gcj9exvx-opensuse | |@yahoo.com) --- Comment #1 from Fabian Vogt <fabian@ritter-vogt.de> --- Can you use strace -ketrace=close to get a backtrace of the close calls? It's unfortunately a common pattern to call close for all available FDs except for certain needed ones. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1207367 http://bugzilla.opensuse.org/show_bug.cgi?id=1207367#c2 Michael Nottebrock <gcj9exvx-opensuse@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(gcj9exvx-opensuse | |@yahoo.com) | --- Comment #2 from Michael Nottebrock <gcj9exvx-opensuse@yahoo.com> --- Again from the very end of the loop(?): ------------------- snip ----------------------------------------------- close(134217720) = -1 EBADF (Bad file descriptor)
/usr/lib64/libc.so.6(__close+0x16) [0x103104] /usr/bin/kdeinit5(main+0x2ce) [0x4e7e] /usr/lib64/libc.so.6(__libc_start_call_main+0x81) [0x275af] /usr/lib64/libc.so.6(__libc_start_main@@GLIBC_2.34+0x8a) [0x27678] /usr/bin/kdeinit5(_start+0x24) [0x6044] close(134217721) = -1 EBADF (Bad file descriptor) /usr/lib64/libc.so.6(__close+0x16) [0x103104] /usr/bin/kdeinit5(main+0x2ce) [0x4e7e] /usr/lib64/libc.so.6(__libc_start_call_main+0x81) [0x275af] /usr/lib64/libc.so.6(__libc_start_main@@GLIBC_2.34+0x8a) [0x27678] /usr/bin/kdeinit5(_start+0x24) [0x6044] close(134217722) = -1 EBADF (Bad file descriptor) /usr/lib64/libc.so.6(__close+0x16) [0x103104] /usr/bin/kdeinit5(main+0x2ce) [0x4e7e] /usr/lib64/libc.so.6(__libc_start_call_main+0x81) [0x275af] /usr/lib64/libc.so.6(__libc_start_main@@GLIBC_2.34+0x8a) [0x27678] /usr/bin/kdeinit5(_start+0x24) [0x6044] close(134217723) = -1 EBADF (Bad file descriptor) /usr/lib64/libc.so.6(__close+0x16) [0x103104] /usr/bin/kdeinit5(main+0x2ce) [0x4e7e] /usr/lib64/libc.so.6(__libc_start_call_main+0x81) [0x275af] /usr/lib64/libc.so.6(__libc_start_main@@GLIBC_2.34+0x8a) [0x27678] /usr/bin/kdeinit5(_start+0x24) [0x6044] close(134217724) = -1 EBADF (Bad file descriptor) /usr/lib64/libc.so.6(__close+0x16) [0x103104] /usr/bin/kdeinit5(main+0x2ce) [0x4e7e] /usr/lib64/libc.so.6(__libc_start_call_main+0x81) [0x275af] /usr/lib64/libc.so.6(__libc_start_main@@GLIBC_2.34+0x8a) [0x27678] /usr/bin/kdeinit5(_start+0x24) [0x6044] close(134217725) = -1 EBADF (Bad file descriptor) /usr/lib64/libc.so.6(__close+0x16) [0x103104] /usr/bin/kdeinit5(main+0x2ce) [0x4e7e] /usr/lib64/libc.so.6(__libc_start_call_main+0x81) [0x275af] /usr/lib64/libc.so.6(__libc_start_main@@GLIBC_2.34+0x8a) [0x27678] /usr/bin/kdeinit5(_start+0x24) [0x6044] close(134217726) = -1 EBADF (Bad file descriptor) /usr/lib64/libc.so.6(__close+0x16) [0x103104] /usr/bin/kdeinit5(main+0x2ce) [0x4e7e] /usr/lib64/libc.so.6(__libc_start_call_main+0x81) [0x275af] /usr/lib64/libc.so.6(__libc_start_main@@GLIBC_2.34+0x8a) [0x27678] /usr/bin/kdeinit5(_start+0x24) [0x6044] close(134217727) = -1 EBADF (Bad file descriptor) /usr/lib64/libc.so.6(__close+0x16) [0x103104] /usr/bin/kdeinit5(main+0x2ce) [0x4e7e] /usr/lib64/libc.so.6(__libc_start_call_main+0x81) [0x275af] /usr/lib64/libc.so.6(__libc_start_main@@GLIBC_2.34+0x8a) [0x27678] /usr/bin/kdeinit5(_start+0x24) [0x6044] close(4) = 0 /usr/lib64/libc.so.6(__close+0x16) [0x103104] /usr/bin/kdeinit5(main+0x10ad) [0x5c5d] /usr/lib64/libc.so.6(__libc_start_call_main+0x81) [0x275af] /usr/lib64/libc.so.6(__libc_start_main@@GLIBC_2.34+0x8a) [0x27678] /usr/bin/kdeinit5(_start+0x24) [0x6044] close(3) = 0 /usr/lib64/libc.so.6(__close+0x16) [0x103104] /usr/bin/kdeinit5(main+0x10df) [0x5c8f] /usr/lib64/libc.so.6(__libc_start_call_main+0x81) [0x275af] /usr/lib64/libc.so.6(__libc_start_main@@GLIBC_2.34+0x8a) [0x27678] /usr/bin/kdeinit5(_start+0x24) [0x6044] +++ exited with 0 +++ ------------------- snip -----------------------------------------------
-- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1207367 http://bugzilla.opensuse.org/show_bug.cgi?id=1207367#c3 Fabian Vogt <fabian@ritter-vogt.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags| |needinfo?(gcj9exvx-opensuse | |@yahoo.com) --- Comment #3 from Fabian Vogt <fabian@ritter-vogt.de> --- Can you try https://invent.kde.org/frameworks/kinit/-/merge_requests/15? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1207367 http://bugzilla.opensuse.org/show_bug.cgi?id=1207367#c4 Michael Nottebrock <gcj9exvx-opensuse@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(gcj9exvx-opensuse | |@yahoo.com) | --- Comment #4 from Michael Nottebrock <gcj9exvx-opensuse@yahoo.com> --- Currently lack the setup to build frameworks from source, unfortunately. Can test again, if it ever makes it into a release. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1207367 http://bugzilla.opensuse.org/show_bug.cgi?id=1207367#c5 Fabian Vogt <fabian@ritter-vogt.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags| |needinfo?(gcj9exvx-opensuse | |@yahoo.com) --- Comment #5 from Fabian Vogt <fabian@ritter-vogt.de> --- (In reply to Michael Nottebrock from comment #4)
Currently lack the setup to build frameworks from source, unfortunately. Can test again, if it ever makes it into a release.
https://build.opensuse.org/package/show/home:Vogtinator:boo1207367/kinit should be available soon -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1207367 http://bugzilla.opensuse.org/show_bug.cgi?id=1207367#c6 Michael Nottebrock <gcj9exvx-opensuse@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(gcj9exvx-opensuse | |@yahoo.com) | --- Comment #6 from Michael Nottebrock <gcj9exvx-opensuse@yahoo.com> --- Works perfectly with ------------------- snip ----------------------------------------------- east:~ # rpm -q kinit kinit-5.102.0-269.1.x86_64 ------------------- snip ----------------------------------------------- and fs.nr_open at max value (0x7FFFFFC0) ------------------- snip ----------------------------------------------- beast:~ # ulimit -a real-time non-blocking time (microseconds, -R) unlimited core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 126667 max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 2147483580 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 126667 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited ------------------- snip ----------------------------------------------- Cheers! -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1207367 http://bugzilla.opensuse.org/show_bug.cgi?id=1207367#c7 Fabian Vogt <fabian@ritter-vogt.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #7 from Fabian Vogt <fabian@ritter-vogt.de> --- Thanks for testing! It should be in KF 5.103. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com