diff options
author | Roger Dingledine <arma@torproject.org> | 2006-06-09 06:35:45 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-06-09 06:35:45 +0000 |
commit | 85d408a573e1408c601369d1979008e678ea5605 (patch) | |
tree | 2467db1f028d08b452e2b8c30b5d453474235673 /src | |
parent | a91be49402c0ace36ab5eca22f55580f9895671d (diff) | |
download | tor-85d408a573e1408c601369d1979008e678ea5605.tar tor-85d408a573e1408c601369d1979008e678ea5605.tar.gz |
Bandaid for a seg fault i just got in 0.1.1.20.
More generally, i reopened bug 222. Whee.
svn:r6571
Diffstat (limited to 'src')
-rw-r--r-- | src/common/log.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/common/log.c b/src/common/log.c index 2cdd8e86c..1d9c10d56 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -327,9 +327,12 @@ close_logs(void) } /** Remove and free the log entry <b>victim</b> from the linked-list - * logfiles (it must be present in the list when this function is - * called). After this function is called, the caller shouldn't refer - * to <b>victim</b> anymore. + * logfiles (it is probably present, but it might not be due to thread + * racing issues). After this function is called, the caller shouldn't + * refer to <b>victim</b> anymore. + * + * Long-term, we need to do something about races in the log subsystem + * in general. See bug 222 for more details. */ static void delete_log(logfile_t *victim) @@ -339,8 +342,10 @@ delete_log(logfile_t *victim) logfiles = victim->next; else { for (tmpl = logfiles; tmpl && tmpl->next != victim; tmpl=tmpl->next) ; - tor_assert(tmpl); - tor_assert(tmpl->next == victim); +// tor_assert(tmpl); +// tor_assert(tmpl->next == victim); + if (!tmpl) + return; tmpl->next = victim->next; } tor_free(victim->filename); |