[tor-commits] [tor/master] prop224: Better missing hsdir index logs.

nickm at torproject.org nickm at torproject.org
Mon Sep 4 16:10:48 UTC 2017


commit 6d48e756855b79becf275c062b4e2fd48ccee23b
Author: George Kadianakis <desnacked at riseup.net>
Date:   Fri Aug 25 17:16:53 2017 +0300

    prop224: Better missing hsdir index logs.
    
    Seems like hsdir index bugs are around to haunt us. Let's improve the
    log messages to make debugging easier.
---
 src/or/hs_common.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/or/hs_common.c b/src/or/hs_common.c
index 03dd07f6c..a5ad26900 100644
--- a/src/or/hs_common.c
+++ b/src/or/hs_common.c
@@ -1206,12 +1206,16 @@ node_has_hsdir_index(const node_t *node, int is_for_next_period)
   if (BUG(node->hsdir_index == NULL) ||
       BUG(tor_mem_is_zero((const char*)node->hsdir_index->current,
                           DIGEST256_LEN))) {
+    log_warn(LD_BUG, "Zero current index (ri: %p, rs: %p, md: %p)",
+             node->ri, node->rs, node->md);
     return 0;
   }
 
   if (is_for_next_period &&
       BUG(tor_mem_is_zero((const char*)node->hsdir_index->next,
                           DIGEST256_LEN))) {
+    log_warn(LD_BUG, "Zero next index (ri: %p, rs: %p, md: %p)",
+             node->ri, node->rs, node->md);
     return 0;
   }
 





More information about the tor-commits mailing list