Closed emmanueltouzery closed 3 years ago
nevermind, I got it, it was my bug. I had a glib idle callback that was going awry. I missed the fact that the rust child process try_wait
would return None
on the exit status if the process was ended by a signal. All ok, pebkac, I should have learned that it's (almost) never relm's fault!
This is my third relm application, but it's the first time I'm seeing this. It must be my fault in some way, but I'd be interested if you have some pointers or suggestions on how to try to track this one down.
I have a relm app, and when I trigger some actions, it goes to 100% cpu use. The GUI is perfectly responsive, everything works, but somehow it's burning 100% of the CPU. I put a dbg! call in the update() function of my main component, but it's not called.
A flamegraph seems to show that the CPU is going in relm::run and the gtk main loop:![image](https://user-images.githubusercontent.com/339433/122125843-3900b880-ce31-11eb-99c5-1efd89fd798a.png)
If you're interested in trying to reproduce this yourself, you can build https://github.com/emmanueltouzery/hotwire (revision 9e89745cb6ddf6046873535ce146924421d64ab5 maybe just in case) run it... you need
tshark
on your machine.. and it must be linux or OSX.. (tested on linux only), make a fifo file (mkfifo test.pcap), start the app, open the fifo in hotwire then after a short amount of time press "capture" to stop the capture. At that point the CPU shoots to 100% and stays there. I am launching external processes, reading from them with pipes and triggering relm events, but strangely enough the problem occurs exactly when I kill the external processes and stop dealing with these external events...