Sean Chittenden wrote:
I've fixed the segfaults plagueing cvs-head.


I'm no longer seeing segfaults, but I'm still getting double free errors.

Nov 15 08:49:56 nfs1 dbmail/imap4d[15979]: dbpgsql.c,db_free_result: trying to free a result set that is already NULL!


Spoke too soon. If you push the imap server hard enough and do a full synchronize, you can segv it.

#6 0x00000000004167ce in dbmail_imap_session_fetch_get_items (self=0x528600) at dbmail-imapsession.c:1730
1730            g_list_foreach(tlist, (GFunc)g_free, NULL);

Ok, I'll rethink that code a bit.

The error I made was quite simple. I built glists of mixed 
allocated/unallocated chars.

GList *l = NULL;
l = g_list_append(l,"no malloc");
l = g_list_append(l,strdup("malloc-ed string"));

calling g_foreach(l,(GFunc)g_free,NULL) will now segfault.

My mistake, born from my lack of experience in using C.

So I go back to the code and make sure glists are more consistently filled with strings that have to be freed or not. Basically I'm just wrapping all the "no malloc" strings in g_strdup()-s whereever I suspect possible mixing. That way everything gets allocated memory. Seems like suboptimal somehow... any ideas ?

--
  ________________________________________________________________
  Paul Stevens                                  mailto:[EMAIL PROTECTED]
  NET FACILITIES GROUP                     PGP: finger [EMAIL PROTECTED]
  The Netherlands________________________________http://www.nfg.nl

Reply via email to