Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
Tor
Commits
96e8e30e
Commit
96e8e30e
authored
12 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/maint-0.2.4'
parents
c547502e
323cb655
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changes/bug7164_diagnostic
+4
-0
4 additions, 0 deletions
changes/bug7164_diagnostic
src/or/microdesc.c
+11
-9
11 additions, 9 deletions
src/or/microdesc.c
src/or/microdesc.h
+3
-1
3 additions, 1 deletion
src/or/microdesc.h
with
18 additions
and
10 deletions
changes/bug7164_diagnostic
0 → 100644
+
4
−
0
View file @
96e8e30e
o Minor features (bug diagnostic):
- If we fail to free a microdescriptor because of bug #7164, log
the filename and line number from which we tried to free it.
This should help us finally fix #7164.
This diff is collapsed.
Click to expand it.
src/or/microdesc.c
+
11
−
9
View file @
96e8e30e
...
...
@@ -550,7 +550,7 @@ microdesc_check_counts(void)
/** Deallocate a single microdescriptor. Note: the microdescriptor MUST have
* previously been removed from the cache if it had ever been inserted. */
void
microdesc_free
(
microdesc_t
*
md
)
microdesc_free
_
(
microdesc_t
*
md
,
const
char
*
fname
,
int
lineno
)
{
if
(
!
md
)
return
;
...
...
@@ -561,12 +561,12 @@ microdesc_free(microdesc_t *md)
microdesc_cache_t
*
cache
=
get_microdesc_cache
();
microdesc_t
*
md2
=
HT_FIND
(
microdesc_map
,
&
cache
->
map
,
md
);
if
(
md2
==
md
)
{
log_warn
(
LD_BUG
,
"microdesc_free() called, but md was still
in
"
"microdesc_map"
);
log_warn
(
LD_BUG
,
"microdesc_free() called
from %s:%d
, but md was still "
"
in
microdesc_map"
,
fname
,
lineno
);
HT_REMOVE
(
microdesc_map
,
&
cache
->
map
,
md
);
}
else
{
log_warn
(
LD_BUG
,
"microdesc_free() called with held_in_map
set, but
"
"microdesc was not in the map."
);
log_warn
(
LD_BUG
,
"microdesc_free() called
from %s:%d
with held_in_map "
"
set, but
microdesc was not in the map."
,
fname
,
lineno
);
}
tor_fragile_assert
();
}
...
...
@@ -580,11 +580,13 @@ microdesc_free(microdesc_t *md)
}
});
if
(
found
)
{
log_warn
(
LD_BUG
,
"microdesc_free() called, but md was still referenced "
"%d node(s); held_by_nodes == %u"
,
found
,
md
->
held_by_nodes
);
log_warn
(
LD_BUG
,
"microdesc_free() called from %s:%d, but md was still "
"referenced %d node(s); held_by_nodes == %u"
,
fname
,
lineno
,
found
,
md
->
held_by_nodes
);
}
else
{
log_warn
(
LD_BUG
,
"microdesc_free() called with held_by_nodes set to %u, "
"but md was not referenced by any nodes"
,
md
->
held_by_nodes
);
log_warn
(
LD_BUG
,
"microdesc_free() called from %s:%d with held_by_nodes "
"set to %u, but md was not referenced by any nodes"
,
fname
,
lineno
,
md
->
held_by_nodes
);
}
tor_fragile_assert
();
}
...
...
This diff is collapsed.
Click to expand it.
src/or/microdesc.h
+
3
−
1
View file @
96e8e30e
...
...
@@ -39,7 +39,9 @@ smartlist_t *microdesc_list_missing_digest256(networkstatus_t *ns,
int
downloadable_only
,
digestmap_t
*
skip
);
void
microdesc_free
(
microdesc_t
*
md
);
void
microdesc_free_
(
microdesc_t
*
md
,
const
char
*
fname
,
int
line
);
#define microdesc_free(md) \
microdesc_free_((md), __FILE__, __LINE__)
void
microdesc_free_all
(
void
);
void
update_microdesc_downloads
(
time_t
now
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment