Sending a buddy request in ICQ fails when using libpurple

michaelcbrook at msn.com michaelcbrook at msn.com
Thu Aug 6 03:30:57 EDT 2009


On Wed, 2009-08-05 at 23:15 -0700, Mark Doliner wrote:
> On Wed, Aug 5, 2009 at 8:29 PM,
> michaelcbrook at msn.com<michaelcbrook at msn.com> wrote:
> > Adding the timeout did not work.  I'm fairly new to backtracing, but I
> > followed the directions from the pidgin wiki and here's what I got:
> >
> > *When the segfault occurred while running:
> >
> > Adding buddy...
> > (20:08:00) oscar: ssi: adding buddy 401787217 to group Buddies
> > (20:08:00) oscar: Requesting ICQ alias for 401787217(20:08:00) oscar:
> > icq response: 60 bytes, 579746952, 0x07da, 0x0024
> > (20:08:00) oscar: ssi: status is 0x000e for a 0x0008 action with name no
> > item
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread 0xb79318d0 (LWP 25796)]
> > purple_auth_request (data=0xb7eceff4, msg=0x8791008 "") at oscar.c:2533
> > 2533            od = gc->proto_data;
> >
> > *The backtrace:
> >
> > #0  purple_auth_request (data=0xb7eceff4, msg=0x8791008 "") at
> > oscar.c:2533
> >        gc = (PurpleConnection *) 0xb6ebc
> >        account = (PurpleAccount *) 0xbfc027a8
> >        buddy = <value optimized out>
> >        group = <value optimized out>
> > #1  0x08048fce in request_input_cb ()
> > No locals.
> > #2  0xb7e522b6 in ?? () from /usr/lib/libglib-2.0.so.0
> > No symbol table info available.
> > #3  0xb7e51b88 in g_main_context_dispatch ()
> > from /usr/lib/libglib-2.0.so.0
> > No symbol table info available.
> > #4  0xb7e550eb in ?? () from /usr/lib/libglib-2.0.so.0
> > No symbol table info available.
> > #5  0xb7e555ba in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
> > No symbol table info available.
> > #6  0x080491e0 in main ()
> > No locals.
> >
> > I also attached the full source code of the program, as simplified as
> > possible (the only difference is that my password is replaced with
> > "PASSWORD").  I compile it with:
> >
> > gcc `pkg-config --libs glib-2.0` -I /usr/include/libpurple/
> > -I /usr/include/glib-2.0/ -I /usr/lib/glib-2.0/include/ test.c -lpurple
> > -o test
> >
> > ...if that makes any difference
> >
> > Let me know if you need any more information.
> 
> I think you may need to pass parameters to the callback functions.
> The user_data variable passed to your request_input function and the
> message text.  See the bottom half of input_response_cb() in
> pidgin/gtkresponse.c for an example.  Specifically:
> 
> ((PurpleRequestInputCb)data->cbs[id])(data->user_data, value);
> 
> -Mark
> 
Ok, I think I understand the concept, but the only thing I'm stuck on is
how to access "data", since in the pidgin source code, it looks like
"data" has the type PidginRequestData, and it's passed from
pidgin_request_input(), but since I don't call pidgin_request_input()
(or purple_request_input()) directly, how do I get the "data" variable?

-Michael




More information about the Support mailing list