Opened 3 years ago

Last modified 21 months ago

#18306 new defect

Avoid using tor_assert before the logging system is fully initialised

Reported by: teor Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-assert bootstrap logging safety
Cc: Actual Points:
Parent ID: Points: 2
Reviewer: Sponsor:

Description

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.

Child Tickets

Change History (11)

comment:1 Changed 3 years ago by nickm

Points: small/medium

comment:2 Changed 3 years ago by nickm

Owner: set to nickm
Status: newaccepted

comment:3 Changed 3 years ago by nickm

Owner: nickm deleted
Status: acceptedassigned

comment:4 Changed 3 years ago by nickm

Status: assignednew

Put all unowned "assigned" tickets back into "new".

comment:5 Changed 3 years ago by nickm

Points: small/medium2

small/medium => 2.

comment:6 Changed 3 years ago by isabela

Keywords: isaremoved added
Milestone: Tor: 0.2.9.x-finalTor: 0.2.???

comment:7 Changed 2 years ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:8 Changed 2 years ago by nickm

Keywords: tor-03-unspecified-201612 added
Milestone: Tor: 0.3.???Tor: unspecified

Finally admitting that 0.3.??? was a euphemism for Tor: unspecified all along.

comment:9 Changed 22 months ago by nickm

Keywords: tor-03-unspecified-201612 removed

Remove an old triaging keyword.

comment:10 Changed 22 months ago by nickm

Keywords: isaremoved removed

comment:11 Changed 21 months ago by nickm

Keywords: tor-assert bootstrap logging safety added
Note: See TracTickets for help on using tickets.