You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
evdev device should call thesefunctions to release resources before closing the device fd. They are wrapped by evdev-rs in the Droptrait.
Currently, the only way to terminate kanata is to kill it by a signal, e.g. SIGINT and SIGTERM.
Rust doesn't unwind and call drop() by default when receive SIGINT and SIGTERM, which causes thosedevices fail to release resources properly.
Relates to #46 , but I think this should be a separate issue and I cannot re-open that issue.
The text was updated successfully, but these errors were encountered:
jian-lin
changed the title
evdev device resources are not correctly release when kanata is killed by signals
evdev device resources are not correctly released when kanata is killed by signals
Jul 21, 2022
I'm not yet sure if what you're saying is correct for a terminating process.
Cleaning up using the functions you describe makes sense for a non-terminating process to not leak resources over time. However, for a terminating process, a non-buggy OS kernel must clean up after processes that die even if they did not do so themselves. Otherwise the kernel would run out of memory or file descriptors due to buggy programs or due to repeated killing via SIGKILL.
What specific resources are not cleaned up correctly? In the previous issue you mentioned a symlink, but if I understand correctly that was unrelated to evdev so that one is not relevant for this bug.
You are probably right about the cleaning stuff done by OS. And if you are right, there is no issue with current kanata.
What specific resources are not cleaned up correctly?
I have no idea what resources are needed by evdev devices.
In the previous issue you mentioned a symlink
Yeah, I come across this "issue" when I think about cleaning a symlink in the signal handler. I missed the point that OS should clean evdev resources for terminated kanata.
evdev device should call these functions to release resources before closing the device fd. They are wrapped by
evdev-rs
in the Drop trait.Currently, the only way to terminate kanata is to kill it by a signal, e.g. SIGINT and SIGTERM.
Rust doesn't unwind and call
drop()
by default when receive SIGINT and SIGTERM, which causes those devices fail to release resources properly.Relates to #46 , but I think this should be a separate issue and I cannot re-open that issue.
The text was updated successfully, but these errors were encountered: