[Adium-devl] g_string_free() and me (aka gaim [17165] doesn't like Adium)

Evan Schoenberg evan at adiumx.com
Fri Sep 8 20:09:50 UTC 2006


Mark,

I dunno, it rhymes.

As of gaim [17165], Adium crashes on connect over Jabber, Yahoo, and  
possibly others.
The same code in gtkgaim doesn't crash.

Gaim [17164] (and previous) don't crash in this way, though it does  
have the crashiness you fixed ('cording to the changelog) in [17165].

------------------------------------------------------------------------
r17165 | thekingant | 2006-09-05 02:10:38 -0400 (Tue, 05 Sep 2006) |  
4 lines

Some proxy love.  This is much less crash-happy.  I'm having
problems getting HTTP proxies to work for me, but my squid
might be misconfigured.  And I haven't tested socks4 or 5 yet.
------------------------------------------------------------------------

I've been hunting through the individual problems, but I think  
something big is messed up somehow, because the places it crashes  
keeps changing.

The first problem I came to was a double-free, it claimed, of  
connect_data->write_buffer.
Changing proxy.c:846 from
connect_data->write_buffer = (guchar *)g_string_free(request, FALSE);
to
	connect_data->write_buffer = request->str;
	g_string_free(request, FALSE);
stops that crash.

The glib we're using definitely claims that g_string_free() returns a  
char*, so I'm not sure why this matters.  In fact, I'm mystified.   
ancient versions of glib returned void in that function... but I  
don't know how an ancient version of glib would come into play here :)
----------
Having 'fixed' that crash, on my next attempt, we crashed shortly  
thereafter, here:
---
#0  0x07dbffd4 in g_slist_free_1 ()
#1  0x07dc03a8 in g_slist_remove ()
#2  0x07caec3c in try_connect ()
#3  0x07cac9c0 in gaim_proxy_connect_data_disconnect ()
#4  0x07cacb50 in socket_ready_cb ()
---
-----------
The next time I attempted to connect, it got through try_connect()  
the first time, then bombed with this stack trace:
---
#0  0xa02965c4 in __CFNSTypeClass ()
#1  0x08c6c9dc in gaim_proxy_connect_data_disconnect ()
#2  0x08c6cb50 in socket_ready_cb ()
#3  0x036fd3a4 in socketCallback (s=0xe4cd310,  
callbackType=kCFSocketWriteCallBack, address=0x0, data=0x0,  
infoVoid=0xe4e6190) at /Users/evands/adium/Plugins/Gaim Service/ 
adiumGaimEventloop.m:297
---
The #0 call makes me think that it's trying to call connect_data- 
 >connect_cb() and connect_cb is invalid, because it's ending up  
calling a random, CoreFoundation function (which is in the same  
memory space since Core Foundation and libgaim are both loaded as  
frameworks fro Adium).

The debug logging just before that was:
16:02:03: (Libgaim: proxy) Connected.
16:02:03: (Libgaim: proxy) gaim_proxy_connect_data_disconnect
16:02:03: (Libgaim: proxy) connect_data->fd is 3
16:02:03: (Libgaim: proxy) Connection attempt failed: Socket  
operation on non-socket

(the middle two are lines I added in  
gaim_proxy_connect_data_disconnect()).

I've unfortunately used up my coding time for the weekend... really,  
I'd used it up before I began... so I'm cc'ing the adium-dev list in  
case you have suggestions or the like. I'll check my email tomorrow- 
ish hopefully.  I've committed a Makefile (and a shell script for  
updating to gaim svn HEAD) to the adium libgaim repository which  
should make it easy for others to build and update libgaim.framework  
(something I should have done long ago).

Thanks for your help,
Evan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20060908/fbac90c9/attachment-0001.html>


More information about the devel mailing list