-
Notifications
You must be signed in to change notification settings - Fork 12
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
“pre Y2K bug”: XQF segfaults when reloading dozens of master servers plenty of servers #9
Comments
This time it segfault in cf. https://github.com/XQF/xqf/blob/master/src/server.c#L452 #0 __GI___libc_malloc(bytes = 12) at malloc.c:2904
#1 g_malloc(n_bytes = 12) at /build/buildd/glib2.0-2.40.2/./glib/gmem.c:97
#2 parse_address(str = 0x9744aa "85.24.217.9:26000", addr = 0x7fffffffdec0, port = 0x7fffffffdeba) at server.c:452
#3 parse_server(token = 0x7fffffffdf20, n = 8, refreshed = 1413061447, saved = 0) at stat.c:530
#4 parse_qstat_record(conn = 0x93c1d0) at stat.c:768
#5 stat_servers_input_callback(chan = 0x95e350, condition = G_IO_IN, conn = 0x93c1d0) at stat.c:926
#6 g_main_dispatch(context = 0x6f1110) at /build/buildd/glib2.0-2.40.2/./glib/gmain.c:3064
#7 g_main_context_dispatch(context = 0x6f1110, context@entry = 0x6f1110) at /build/buildd/glib2.0-2.40.2/./glib/gmain.c:3663
#8 g_main_context_iterate(context = 0x6f1110, block = 1, block@entry = 1, dispatch = 1, dispatch@entry = 1, self = <optimized out>) at /build/buildd/glib2.0-2.40.2/./glib/gmain.c:3734
#9 g_main_loop_run(loop = 0x7ff3e0) at /build/buildd/glib2.0-2.40.2/./glib/gmain.c:3928` This code: int parse_address (char *str, char **addr, unsigned short *port) {
char *ptr;
// …
*addr = g_malloc (ptr - str + 1); What is that? cf. https://developer.gnome.org/glib/2.28/glib-Memory-Allocation.html#g-malloc |
sigabrt, stat.c:534 https://github.com/XQF/xqf/blob/master/src/stat.c#L534 #0 __GI_raise(sig = 6, sig@entry = 6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 __GI_abort() at abort.c:89
#2 __libc_message(do_abort = 1, do_abort@entry = 1, fmt = 0x7ffff5d7e668 "*** Error in `%s': %s: 0x%s ***\\n", fmt@entry = 0x7ffff5d7e668 "*** Error in `%s': %s: 0x%s ***\\n") at ../sysdeps/posix/libc_fatal.c:175
#3 malloc_printerr(str = 0x7ffff5d7e808 "free(): invalid next size (fast)", action = 1) at malloc.c:4996
#4 _int_free(av = <optimized out>, p = <optimized out>, have_lock = 0) at malloc.c:3840
#5 parse_server(token = 0x7fffffffdf20, n = 8, refreshed = 1413062385, saved = 0) at stat.c:534
#6 parse_qstat_record(conn = 0x835c10) at stat.c:768
#7 stat_servers_input_callback(chan = 0x835800, condition = G_IO_IN, conn = 0x835c10) at stat.c:926
#8 g_main_dispatch(context = 0x6f11f0) at /build/buildd/glib2.0-2.40.2/./glib/gmain.c:3064
#9 g_main_context_dispatch(context = 0x6f11f0, context@entry = 0x6f11f0) at /build/buildd/glib2.0-2.40.2/./glib/gmain.c:3663
#10 g_main_context_iterate(context = 0x6f11f0, block = 1, block@entry = 1, dispatch = 1, dispatch@entry = 1, self = <optimized out>) at /build/buildd/glib2.0-2.40.2/./glib/gmain.c:3734
#11 g_main_loop_run(loop = 0x8456e0) at /build/buildd/glib2.0-2.40.2/./glib/gmain.c:3928
#12 gtk_main() at :0
#13 main(argc = 2, argv = 0x7fffffffe298) at xqf.c:4079 This part: char *addr;
//…
if (!parse_address (token[1], &addr, &port))
return NULL;
h = host_add (addr);
g_free (addr) |
with |
I suppose we must do |
|
Baaaad, this bug is at least more than 14 years old, before the first cvs commit ! It survived to the svn migration! Perhaps since the beginning! 😱 😱 😱 😱 😱 😱 😱 😱 already there in 2000: Line 372 in 9ca134e
🎆 🎆 🎆 I fixed the “pre Y2K bug” ! 🎆 🎆 🎆 |
Youpi, I can query 25 master server and list 1589 server without segfault. 🌀 See the commit that fix the bug: edcf3bf |
The bug that causes some servers appearing blank when querying many servers is another bug. |
How to reproduce:
It’s in the server listing part, not the master server part.
The text was updated successfully, but these errors were encountered: