Hi, I’ve been working on a patch for Seahorse to fix a CPU issue. It appears that the IOChannel wasn’t catching the HUP signal anytime it dropped to the CLI to run a SSH command (change a key passphrase or generate a new one). This was causing the main_loop thread to run at 100% CPU until Seahorse was closed. In my patch I catch the HUP and it fixes the error. My questions:
- What should I do with the HUP in particular? Anything or just acknowledge it?
- What should I do to get this patch over the finish line and merged?
- Fixing a CPU bug like this is in my opinion a fairly important thing - I agree with the original issue reporter; I found the report when I noticed my laptop sounded like it was going to take off after generating a key. Is it worthy to include a bit of text in the next release notes mentioning this behavior is corrected? (when it’s merged/fixed)
Reported Issue: https://gitlab.gnome.org/GNOME/seahorse/-/issues/290
My likely very WIP Fix: https://gitlab.gnome.org/GNOME/seahorse/-/merge_requests/136
The top secret doc that lend me to my fix: http s://wiki.gnome.org/Projects/Vala/IoChannelsSample
Nuggets I’ve since found:
- http s://github.com/GNOME/glib/blob/3dec72b946a527f4b1f35262bddd4afb060409b7/glib/gpoll.h#L82-L84
- http s://github.com/GNOME/glib/blob/086dccaa6f05696c001ec9d5eb2291eecfebc89a/gio/gsocket.c#L4198
I got the idea for it code wise just by reading the doc’s but it doesn’t fully explain why the HUP bit is in their and it certainly doesn’t mention that excluding or failing to capture it will cause a race condition. If I understand it correctly or with help from others I’d be happy to amend the docs to be more explicit.
I’d like to continue to work on Seahorse. I find the mix of language interesting. I’ve struggled to get tests written up since it doesn’t have any. Is this my lack of experience with Vala or just a general side effect of the language? I tried mining secrets from some other apps (Geary namely) but I have’t been successful yet. Is it viable to think the application could be ported to something like Rust or Python? Is Rust in particular mature enough from a Gnome perspective to use for this and stay away from an interpreter if it’s used in mobile?
Update: I found the following thread (broken link still - #newbie) http s://discourse.gnome.org/t/cpu-100-due-to-g-io-hup/3464/6 which I hadn’t seen yet. It’s my exact case. So it confirms I need to handle the HUP. I’d just like to know what I’m expected to do with it over IO_IN …
Links are intentionally broken, apparently newbie me is limited to 2 links per post.