Bug 491022 - ksmserver spams logs with "[warn] epoll_wait: Bad file descriptor"
Summary: ksmserver spams logs with "[warn] epoll_wait: Bad file descriptor"
Status: RESOLVED NOT A BUG
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.27.11
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-30 12:16 UTC by Erik Quaeghebeur
Modified: 2024-07-30 14:37 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Quaeghebeur 2024-07-30 12:16:35 UTC
SUMMARY
In my logs, there are thousands of repetitions of "ksmserver[522058]: [warn] epoll_wait: Ongeldige bestandsdescriptor". ('Ongeldige bestandsdescriptor' translates to 'Bad file descriptor' or 'Invalid file descriptor'.) These repetitions happen within the same microsecond re-occur during a single session.

STEPS TO REPRODUCE
1. Start session
2. Do some work
3. Look at logs

OBSERVED RESULT
Log spam as described in the summary.

EXPECTED RESULT
No log spam, repetitions are either rate limited or something smarter is done dealing with the underlying issue

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.27.11.1
KDE Frameworks Version: 5.116
Qt Version: 5.15.14
Comment 1 Harald Sitter 2024-07-30 13:17:49 UTC
Rate limiting is solved by journald https://www.freedesktop.org/software/systemd/man/latest/journald.conf.html#RateLimitIntervalSec=
Comment 2 Erik Quaeghebeur 2024-07-30 14:27:40 UTC
(In reply to Harald Sitter from comment #1)
> Rate limiting is solved by journald
> https://www.freedesktop.org/software/systemd/man/latest/journald.conf.
> html#RateLimitIntervalSec=

That is too crude: it is global over all units and removes all log entries from a unit. I need a massively repeated log line to be removed.
It may be that this component is not the one to blame, but that the issue lies in a supporting framework/library. Namely, I saw that the kalendarac unit also does spamming like this.

In any case, this report is bigger than just a request for rate limiting. The fact that KDE components can trigger this warning lots of times per *micro*second and multiple times in a session (e.g., I've got stretches at 17:38:55.887024, 17:38:55.868863, 17:38:55.854864,…) does seem to suggest there is some kind of bug. Already the fact that bad file descriptors are passed could be considered a bug, let alone repeatedly doing so in a massive way.

So, please reopen this bug and help me find out which component is misbehaving.
Comment 3 Harald Sitter 2024-07-30 14:37:19 UTC
(In reply to Erik Quaeghebeur from comment #2)
> (In reply to Harald Sitter from comment #1)
> > Rate limiting is solved by journald
> > https://www.freedesktop.org/software/systemd/man/latest/journald.conf.
> > html#RateLimitIntervalSec=
> 
> That is too crude: it is global over all units 

"This rate limiting is applied per-service"

> 
> In any case, this report is bigger than just a request for rate limiting.
> The fact that KDE components can trigger this warning lots of times per
> *micro*second and multiple times in a session (e.g., I've got stretches at
> 17:38:55.887024, 17:38:55.868863, 17:38:55.854864,…) does seem to suggest
> there is some kind of bug. Already the fact that bad file descriptors are
> passed could be considered a bug, let alone repeatedly doing so in a massive
> way.
> 
> So, please reopen this bug and help me find out which component is
> misbehaving.

Feel free to track down where the fd comes from. Right now there's no actionable information here.  strace and/or gdb breaking on the warning should get you started.