Created attachment 225539 [details]
Patch for devel/efl to fix eftreetd crash.
I have discovered a pretty major bug in efl which affects efreetd and in turn affects enlightenment. It happens when a large number of icons or theme resources / assets are installed into /usr/local/share/... The efreetd daemon crashes with "Abort trap" error message when run from a users terminal. It causes the application menu icons to disappear, partially or fully. It can also cause an error message about efreetd (cache) not connecting with a timeout. It also causes problems with the initial enlightenment prompts with a fresh .e profile.
I have a good solution that I have a patch for an immediate fix, until I make a PR with the upstream efl project. I'd like to hear the thoughts of the FreeBSD enlightenment team before I engage with them.
Steps to reproduce:
Install any major KDE app like Dolphin, Gwenview, Okular etc. Or specifically kf5-breeze-icons. Then run efreetd as a regular user from a TTY (no X sessions running).
I have a more thorough description of the problem on the FreeBSD Forums:
The patch is attached.
Is it possible to get an enlightenment port revision with this patch out the door ASAP. I have been running it in production on my media-centre for almost 2 weeks now, no issues. Everything else seems fine, the performance seems to be as good if not better than the same version of Enlightenment/EFL on Manjaro Linux (very similar hardware).
It's a pretty urgent bug fix. I am new to enlightenment and loving it now. But I very nearly turned my back on it an use KDE instead, before even giving it a chance. If I had known it would take me 2-3 solid weeks to find the bug I never would have started. This is not just personal time, it is work time that I would not be spending, had I known how long it would take. It only took about 5 mins to fix once I found the problem, but that's usually how it goes with debugging.
I've asked the opinion of developers of EFL.
Please, stay tuned :)
The answer from Carsten Haitzler:
oh > 1024 fd's ... with ye olde select. yeah. that may have issues. I can throw
this into git master. for now carrying a patch in the bsd package builds would
be the right thing. the fix will then be in the next efl release.
I'll try to patch the port in the next days.
Thank you so much Peter. I'm so glad to this getting taken seriously by upstream, and the response time is amazing. I had a feeling this bug was affecting users for a long time. I've seen so many reports of strange efreetd behaviour by Enlightenment users over the last few years. I thought it was more widespread than just the BSD's. That's one of the reasons I kept going with this most difficult bug to track down.
A commit in branch main references this bug:
Author: Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2021-06-04 16:39:30 +0000
Commit: Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2021-06-04 16:43:20 +0000
devel/efl: Add a workaround for efreetd crash.
Tested by: Euan Thoms <firstname.lastname@example.org>
devel/efl/Makefile | 2 +-
devel/efl/files/patch-src_lib_ecore_ecore__main.c (new) | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
(In reply to Euan Thoms from comment #3)
Pushed in, thank you.
> I had a feeling this bug was affecting users for a long time.
And AFAIK, you're not mistaken.
> That's one of the reasons I kept going with this most difficult bug to track down.
This is greatly appreciated. If you're still up to it, you might want to implement a correct fix to this issue - use kqueue/kevent mechanism, which is much more performant and scalable compared to select().
EFL probably already have some sort of wrapper for Linux epoll and BSD kevent, so this shouldn't be too hard.
(In reply to Gleb Popov from comment #5)
> EFL probably already have some sort of wrapper for Linux epoll and BSD kevent, so this shouldn't be too hard.
I'll try to take a look into it if I get some time. Whilst I more or less know what kqueue is/does, I have not coded with it before. But I'd like to learn.