google-code-export / microblog-purple

Automatically exported from code.google.com/p/microblog-purple
GNU General Public License v3.0
2 stars 0 forks source link

incorrect DNS result for api.twitter.com make pidgin crashed #212

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. edit hosts file, add a line "1.2.3.4 api.twitter.com"
2. run pidgin
3. create a new twitter account

What is the expected output? What do you see instead?
pidgin crashed

What version of the product are you using? On what operating system?
pidgin 2.7.3
microblog-purple 0.3.0
OS: ubuntu

Please provide any additional information below.

debug output:

(13:36:26) util: requesting to fetch a URL
(13:36:26) dns: DNS query for 'api.twitter.com' queued
(13:36:26) twitter: looking for twitgin
(13:36:26) twitter: registering twitgin-replying-message signal
(13:36:26) dns: Created new DNS child 5856, there are now 1 children.
(13:36:26) dns: Successfully sent DNS request to child 5856
(13:36:26) dns: Got response for 'api.twitter.com'
(13:36:26) dnsquery: IP resolved for api.twitter.com
(13:36:26) proxy: Attempting connection to 1.2.3.4
(13:36:26) proxy: Connecting to api.twitter.com:443 with no proxy
(13:36:26) proxy: Connection in progress
(13:36:32) util: Writing file accounts.xml to directory /home/xxxx/.purple
(13:36:32) util: Writing file /home/xxxx/.purple/accounts.xml
(13:36:32) util: Writing file blist.xml to directory /home/xxxx/.purple
(13:36:32) util: Writing file /home/xxxx/.purple/blist.xml
dns[5856]: nobody needs me... =(
(13:36:47) proxy: Connecting to api.twitter.com:443.
(13:36:47) proxy: Error connecting to api.twitter.com:443 (Connection timed 
out).
(13:36:47) proxy: Connection attempt failed: Connection timed out
(13:36:47) mb_net: mb_conn_fetch_url_cb: url_data = 0x1e78d00
(13:36:47) mb_net: mb_conn_data_free: conn_data = 0x1e7e800
(13:36:47) mb_net: freeing host name
(13:36:47) mb_net: freeing HTTP data->response
(13:36:47) mb_http: freeing http data
(13:36:47) mb_http: freeing header hash table
(13:36:47) mb_http: freeing self
(13:36:47) mb_net: freeing HTTP data->request
(13:36:47) mb_http: freeing http data
(13:36:47) mb_http: freeing host
(13:36:47) mb_http: freeing path
(13:36:47) mb_http: freeing header hash table
(13:36:47) mb_http: freeing fixed headers
(13:36:47) mb_http: freeing each parameter
(13:36:47) mb_http: freeing parameter, oauth_consumer_key=PCWAdQpyyR12ezp2fVwEhw
(13:36:47) mb_http: freeing parameter, oauth_nonce=SBhQpIpHfG2bi3WTQUHbDsSR6RNb
(13:36:47) mb_http: freeing parameter, oauth_signature_method=HMAC-SHA1
(13:36:47) mb_http: freeing parameter, oauth_timestamp=1283060186
(13:36:47) mb_http: freeing parameter, oauth_version=1.0
(13:36:47) mb_http: freeing parameter, 
oauth_signature=sPbgMLpAWtKnzzV6uq3Ifkw1Nuo=
(13:36:47) mb_http: freeing all params
(13:36:47) mb_http: freeing packet
(13:36:47) mb_http: freeing self
(13:36:47) mb_net: unregistering conn_data from MbAccount
(13:36:47) mb_net: freeing self at 0x1e7e800
(13:36:47) mboauth: mb_oauth_request_token_handler called
Segmentation fault

Original issue reported on code.google.com by worldweave@gmail.com on 29 Aug 2010 at 5:41

GoogleCodeExporter commented 9 years ago
if the account has been created, pidgin will say "Unable to connect to 
api.twitter.com: SSL Connection Failed" and then crash

(13:44:40) util: requesting to fetch a URL
(13:44:40) dns: DNS query for 'api.twitter.com' queued
(13:44:40) twitter: looking for twitgin
(13:44:40) twitter: registering twitgin-replying-message signal
(13:44:40) autorecon: done calling purple_account_connect
(13:44:40) dns: Wait for DNS child 6022 failed: No child processes
(13:44:40) dns: Created new DNS child 6024, there are now 1 children.
(13:44:40) dns: Successfully sent DNS request to child 6024
(13:44:40) dns: Got response for 'api.twitter.com'
(13:44:40) dnsquery: IP resolved for api.twitter.com
(13:44:40) proxy: Attempting connection to 1.2.3.4
(13:44:40) proxy: Connecting to api.twitter.com:443 with no proxy
(13:44:40) proxy: Connection in progress
dns[6024]: nobody needs me... =(
(13:45:01) proxy: Connecting to api.twitter.com:443.
(13:45:01) proxy: Error connecting to api.twitter.com:443 (Connection timed 
out).
(13:45:01) proxy: Connection attempt failed: Connection timed out
(13:45:01) mb_net: mb_conn_fetch_url_cb: url_data = 0xb4ef90
(13:45:01) mb_net: mb_conn_data_free: conn_data = 0xb4ecc0
(13:45:01) mb_net: freeing host name
(13:45:01) mb_net: freeing HTTP data->response
(13:45:01) mb_http: freeing http data
(13:45:01) mb_http: freeing header hash table
(13:45:01) mb_http: freeing self
(13:45:01) mb_net: freeing HTTP data->request
(13:45:01) mb_http: freeing http data
(13:45:01) mb_http: freeing host
(13:45:01) mb_http: freeing path
(13:45:01) mb_http: freeing header hash table
(13:45:01) mb_http: freeing fixed headers
(13:45:01) mb_http: freeing each parameter
(13:45:01) mb_http: freeing parameter, oauth_consumer_key=PCWAdQpyyR12ezp2fVwEhw
(13:45:01) mb_http: freeing parameter, oauth_nonce=1Sj82uNao48sj46wNryzEoWXJOeTt
(13:45:01) mb_http: freeing parameter, oauth_signature_method=HMAC-SHA1
(13:45:01) mb_http: freeing parameter, oauth_timestamp=1283060680
(13:45:01) mb_http: freeing parameter, 
oauth_token=184100932-NGNM6pR31kMnvYfPWnAgycyuayB00CHAMYEaabec
(13:45:01) mb_http: freeing parameter, oauth_version=1.0
(13:45:01) mb_http: freeing parameter, 
oauth_signature=6YT0/X6gtJW+Kn6DEfL5YKHkrH0=
(13:45:01) mb_http: freeing all params
(13:45:01) mb_http: freeing packet
(13:45:01) mb_http: freeing self
(13:45:01) mb_net: unregistering conn_data from MbAccount
(13:45:01) mb_net: freeing self at 0xb4ecc0
Segmentation fault

Original comment by worldweave@gmail.com on 29 Aug 2010 at 5:47

GoogleCodeExporter commented 9 years ago
Here is my investigation: crashh occures in twitter_verify_authen() when it 
accesses conn_data->response.

It happens because conn_data->response is already freed in 
mb_conn_fetch_url_cb(): Here is the code (line 162 on trunk)

    if(error_message != NULL) {
       mb_conn_data_free(conn_data); // <-- it frees conn_data and conn_data->response
       if(conn_data->handler) {
          retval = conn_data->handler(conn_data, conn_data->handler_data, error_message); // it calls twitter_verify_authen() which access conn_data and conn_data->response

Classic fault ;-)

Patch is attached

Original comment by e.a.agaf...@gmail.com on 19 Jan 2011 at 9:24

Attachments:

GoogleCodeExporter commented 9 years ago
Nice work. I was just in the process of investigating this myself... it can 
also happen when a network connection is dropped, or when coming out of standby.

Thanks for the patch

Original comment by mikeage on 19 Jan 2011 at 9:56

GoogleCodeExporter commented 9 years ago
Patch landed in SVN. Thanks for your help.

Original comment by somsaks on 19 Jan 2011 at 12:18

GoogleCodeExporter commented 9 years ago
You are welcome!

I'm interested in the plugin ;-)
So wait for more patches

Original comment by e.a.agaf...@gmail.com on 24 Jan 2011 at 9:39