Crash at purple_dnsquery_destroy()

ccpaging ccpaging at gmail.com
Thu Nov 6 23:12:14 EST 2008


I have found same problem in my wifi network both in ubuntu and windows.
The solution seems working now.




ccpaging
2008-11-07



发件人: Jacky Lam
发送时间: 2008-11-06 15:22:37
收件人: devel
抄送: 
主题: Crash at purple_dnsquery_destroy()

Dear all,
Currently, I experience crash at dnsquery.c:purple_dnsquery_destroy()
when my WiFi AP suddenly off while I am online with libpurple.
After tracing, I find the data struct PurpleDnsQueryData is freeing
twice. The reason is when purple_dnsquery_failed() is called,
purple_dnsquery_destroy() will try to free the PurpleDnsQueryData's
resolver and itself. But purple_dnsquery_resolver_destroy()'s kill()
will trigger the glib's input hook and finally called host_resolved()
and eventually call purple_dnsquery_failed() again!!
My solution is simple. Just reverse the older to free the object will be ok.
Origin code:
if (resolver->dns_pid > 0)
kill(resolver->dns_pid, SIGKILL);
if (resolver->inpa != 0)
purple_input_remove(resolver->inpa);
Fixed code:
if (resolver->inpa != 0)
{
purple_input_remove(resolver->inpa);
resolver->inpa=0;
}
if (resolver->dns_pid > 0)
kill(resolver->dns_pid, SIGKILL);
I don't know if it applies to all platform nor it has better way to do
that, but hope it is useful to others having this problem.
Thanks.
BR,
Jacky
_______________________________________________
Devel mailing list
Devel at pidgin.im
http://pidgin.im/cgi-bin/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20081107/e6fb9aea/attachment-0001.html>


More information about the Devel mailing list