[tor-bugs] #18306 [Tor]: Avoid using tor_assert before the logging system is fully initialised
Tor Bug Tracker & Wiki
blackhole at torproject.org
Fri Feb 12 06:43:41 UTC 2016
#18306: Avoid using tor_assert before the logging system is fully initialised
------------------------+--------------------------------
Reporter: teor | Owner:
Type: defect | Status: new
Priority: Medium | Milestone: Tor: 0.2.9.x-final
Component: Tor | Version:
Severity: Normal | Keywords:
Actual Points: | Parent ID:
Points: | Sponsor:
------------------------+--------------------------------
In #18241, we discovered that an assertion failure that occurs before or
during the initialisation of the logging system causes an infinite loop.
We need to check tor and the tools for these kinds of issues.
In particular, the logging system initialises the log mutex.
tor_mutex_init() can still call tor_assert if it fails, so the possibility
of this stack overflow still exists when we're initialising the log mutex
itself.
Now these kinds of failures don't happen very often, and if they do, it's
unlikely tor would ever launch. But it would be better to use
`fprintf(stderr, ...);` in these circumstances so that users can see the
actual log message.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/18306>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list