[Dovecot] dict: Leaked a t_pop() call in I/O handler
Hello,
I've just installed another postfix+dovecot based mail service (I love dovecot! :-), and I found this message "dict: Leaked a t_pop() call in I/O handler (nil)" being logged each time I authenticate against it via POP3 or IMAP.
Searching through the code, I've found this (this is Dovecot v1.0.8):
---- src/dict/dict-cache.c ---- void dict_cache_unref(struct dict_cache *cache, const char *uri, const char *username) { struct dict_entry *entry;
t_push();
entry = hash_lookup(cache->dicts,
t_strdup_printf("%s\t%s", username, uri));
i_assert(entry != NULL && entry->refcount > 0);
if (--entry->refcount == 0) {
hash_remove(cache->dicts, entry->user_uri);
dict_deinit(&entry->dict);
i_free(entry->user_uri);
i_free(entry);
}
} ---- src/dict/dict-cache.c ----
Notice the "t_push()" call there. So calling t_pop() somewhere before the end of the function, makes dovecot work like a charm (again).
P.D: I'm really surprised that nobody noticed this before. Am I the only man in the world who uses Dovecot storing quota information into a SQL Database? ;-)
-- Sergio López - sergio.lopez@nologin.es Nologin Consulting S.L. - http://nologin.es
On Mon, 2007-12-10 at 10:20 +0100, Sergio Lopez wrote:
---- src/dict/dict-cache.c ----
Notice the "t_push()" call there. So calling t_pop() somewhere before the end of the function, makes dovecot work like a charm (again).
Fixed, thanks.
P.D: I'm really surprised that nobody noticed this before. Am I the only man in the world who uses Dovecot storing quota information into a SQL Database? ;-)
Yes, you probably are. :) v1.0's dict implementation is a bit inefficient and not entirely accurate when mailbox is updated simultaneously by multiple processes.
participants (2)
-
Sergio Lopez
-
Timo Sirainen