Open denesb opened 8 years ago
I forgot to mention: I use the latest version of i3ipc-glib from master.
Crashing is something we should never do so I will look into how to fix that.
i3#2318 will add a proper shutdown event to the ipc protocol which will help with this a lot. I would like to add this to the 2.0 release. That should also enable the possibility of a flag on the connection that will make it automatically reconnect on restarts.
In general, since restart is such a hard command to handle from the ipc, I recommend people not use it at all, and instead use reload
which should have all the same functionality but with less bugs.
Also, I plan to deprecate the "ipc-shutdown" event in favor of the new event (which I will call simply "shutdown") that will be totally supported by the protocol. The new auto reconnect flag I'm planning with that event should handle your use case well for recent versions of i3 (when the event is implemented) by reconnecting to the socket internally so you won't have a need to recreate the object.
OK, thanks for the heads up. I'll hold off fixing my issue until 2.0 is released.
While investigating this issue I consistently met crashes inside i3ipc-glib when restarting i3. Since I wasn't entirely confident that the bug was not in my code I created a minimal program to reproduce the issue (see reproduce.txt) and on my box this crashes approximately 1 out of 5 times upon restarting i3. This is the stack trace on my box:
My plugin always crashes at
i3ipc-connection.c:539
also, although the stack below is different. Anyone else had this issue?