SR: Use BUG() instead of tor_assert() when we can
Example:
tor_assert(sr_state_get_phase() == SR_PHASE_REVEAL);
Should be replaced by:
if (BUG(sr_state_get_phase() != SR_PHASE_REVEAL))
return;
The idea is to not kill the dirauth if this happens but still scream very loudly. Few other places in the SR subsystem can be found.
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- David Goulet changed milestone to %Tor: 0.3.5.x-final
changed milestone to %Tor: 0.3.5.x-final
- David Goulet added 034-removed-20180328 034-triage-20180328 035-backport component::core tor/tor dirauth disaster-waiting-to-happen easy milestone::Tor: 0.3.5.x-final owner::dgoulet points::0.2 priority::medium resolution::fixed reviewer::dgoulet severity::minor status::closed tor-sr type::enhancement labels
Finally admitting that 0.3.??? was a euphemism for Tor: unspecified all along.
Trac:
Milestone: Tor: 0.3.??? to Tor: unspecified
Keywords: tor-sr dirauth easy deleted, tor-sr, tor-03-unspecified-201612, dirauth, easy addedRemove an old triaging keyword.
Trac:
Keywords: tor-03-unspecified-201612 deleted, N/A addedTrac:
Keywords: N/A deleted, disaster-waiting-to-happen added
Milestone: Tor: unspecified to Tor: 0.3.2.x-final
Priority: Low to High
Cc: N/A to dgoulet, asnPatch to replace tor_assert() with BUG() in SR code whenever possible
I have a patch to fix this as the file bug_shared_random_patch_r1.patch.
- Author
Trac:
Reviewer: N/A to dgoulet
Status: new to needs_review
Cc: dgoulet, asn to asn Does this patch pass the unit tests? It looks like the BUG() conditions are mostly inverted. (That is, when the old code would say "assert(x)", this code says "if (BUG(x))" when "if (BUG(!x))" would make more sense.)
Also, is this patch just a matter of "replace all the assertions", or does it try to replace only the assertions that are fragile for one reason or another?
Trac:
Milestone: Tor: 0.3.2.x-final to Tor: 0.3.3.x-final
Status: needs_review to needs_revisionTrac:
Cc: asn to asn, neel@neelc.orgPatch to replace tor_assert() with BUG() in SR code whenever possible (Revision 2)
I have made an updated patch under the file bug_shared_random_patch_r2.patch.
The changes I have made this file is to use the correct use of the BUG() function.
I switched tor_assert() to BUG() in shared_random.c and shared_random_state.c in functions that seem related to SR and who's return values are void.
- Author
Trac:
Status: needs_revision to needs_review - Author
Trac:
Owner: N/A to dgoulet
Status: needs_review to assigned - Author
Trac:
Priority: High to Medium - Author
Trac:
Milestone: Tor: 0.3.3.x-final to Tor: 0.3.4.x-final Trac:
Keywords: N/A deleted, 034-triage-20180328 added