New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port XQF to G_IO #4
Comments
First, we can replace diff --git a/src/stat.c b/src/stat.c
index 1ed1fb9..5f730b0 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -915,7 +915,7 @@ static void stat_servers_input_callback (struct stat_conn *conn, int fd,
if (conn->buf[conn->lastnl] == '\0') {
blocked = TRUE;
- gdk_input_remove (conn->tag);
+ g_source_remove (conn->tag);
parse_qstat_record (conn); but it will not remove the It seems that using Replacing |
I created the branch |
The commit cf2b506 is a first attempt. It does not work because I get a problem like this one:
This is what happens with my code. Tracing with gdb, I see that when I update a master server (like etmaster.idsoftware.com for Wolf:ET), it crashes like that:
Tracing with nemiver/gdb I see that:
|
We must find a way to prevent |
This bug affect The current changes are here: cf2b506 |
As Chris Vine said:
So, I rewrite the callbacks to return gboolean : 0351e93 The problem is not fixed, but it will be better like that. |
We can read how g_io_add_watch is declared and how it calls g_io_add_watch_full to see how we can pass a callback function as reference. https://git.gnome.org/browse/glib/tree/glib/giochannel.c#n700 This part seems OK. |
One thing to change, Changing that will probably not fix the segfault because the segfault appears before the function attempt to read fd. But we MUST rewrite that. There is probably a collateral damage due to the fact that For information, the ssize_t read(int fd, void *buf, size_t count); The GIOStatus
g_io_channel_read_chars (GIOChannel *channel,
gchar *buf,
gsize count,
gsize *bytes_read,
GError **error); cf. https://developer.gnome.org/glib/stable/glib-IO-Channels.html#g-io-channel-read-chars Fix in 89dafe5 . |
Another problem:
in stat.h:
But because I fix that. |
As seen on https://git.gnome.org/browse/glib/tree/glib/giounix.c#n165 old callback takes see f084f66 |
Works, but there is always When source was blocked, there was two Drop the cf. 4553122 |
champagne ! 💃 I got it ! The branch g_io was just merged into master, huhu. I can reload dozens of master server plenty of servers without segfault IN THIS PART. (oh yes, I get a segfault elsewhere, but in another part, will be another ticket, the #9). |
Many many thanks for Chris Vine for his precious help! |
Notice : the wrong freeing was there in the first CVS commit in year 2000, so it is another “pre y2k bug”. |
XQF uses old and deprecated functions like
gdk_input_remove
orgdk_input_add
.The problem is that:
You can read here:
https://developer.gnome.org/gdk2/stable/gdk2-Input.html#gdk-input-remove
Fallback for
gdk_input_remove
seems to be an overlay ofg_source_remove
.You can read here the glib 2.39.0 releases notes:
https://download.gnome.org/sources/glib/2.39/glib-2.39.0.news
So, without modification, when XQF updates server list, it prints many error messages like that:
and sometimes crashes like that:
To see XQF crashing you must update many servers and well populated master servers (like Nexuiz), sometimes many times. If you are unlucky, it could be fast to have a crash, or not. Sometime I update 20+ master servers without problem, sometime I update one master server and it crashes (prefer Nexuiz master servers for testing ;-) ).
The text was updated successfully, but these errors were encountered: