Skip to content

Instantly share code, notes, and snippets.

@nullren
Created January 13, 2013 04:41
Show Gist options
  • Save nullren/4522349 to your computer and use it in GitHub Desktop.
Save nullren/4522349 to your computer and use it in GitHub Desktop.
i get a seg fault in this loop
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x0000555555587466 in bee_user_by_handle ()
#2 0x0000555555587685 in imcb_buddy_status ()
#3 0x000055555558793b in bee_user_new ()
#4 0x0000555555588740 in imcb_add_buddy ()
#5 0x00007ffff5253e51 in smsgcm_main_loop (data=0x5555558441c0, fd=<optimized out>, cond=<optimized out>) at smsgcm.c:19
#6 0x00007ffff77213cb in ?? () from /usr/lib/libglib-2.0.so.0
#7 0x00007ffff7720845 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#8 0x00007ffff7720b78 in ?? () from /usr/lib/libglib-2.0.so.0
#9 0x00007ffff7720f72 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#10 0x000055555556740f in main ()
int already_added_bob = 0;
/* main loop */
gboolean smsgcm_main_loop(gpointer data, gint fd, b_input_condition cond)
{
struct im_connection *ic = data;
// Check if we are still logged in...
if (!g_slist_find(smsgcm_connections, ic))
return 0;
// Do stuff..
//smsgcm_load_messages(ic);
if( !already_added_bob ){
imcb_add_buddy(ic, "bob", NULL);
already_added_bob = 1;
}
// If we are still logged in run this function again after timeout.
return (ic->flags & OPT_LOGGED_IN) == OPT_LOGGED_IN;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment