Opened 2 months ago

Last modified 2 months ago

#31608 new defect

circuit_state_publish() never triggers when a new origin circuit is created

Reported by: dgoulet Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-circuit, tor-pubsub, 042-deferred-20190918
Cc: catalyst Actual Points:
Parent ID: #31609 Points: 0.1
Reviewer: Sponsor:

Description

In origin_circuit_init(), we change the circuit state before allocating the build_state but also before a purpose is set.

This means that circuit_state_publish() located in circuit_set_state() is never called for a new circuit because CIRCUIT_IS_ORIGIN() doesn't return true.

Which in turn, by chance I believe, made this NULL deref on build_state to never happen.

This should be fixed regardless.

Child Tickets

Change History (6)

comment:1 Changed 2 months ago by dgoulet

Parent ID: #31609

comment:2 Changed 2 months ago by dgoulet

Keywords: tor-pubsub added

comment:3 Changed 2 months ago by dgoulet

Cc: catalyst added

This issue, if #31609 is fixed, breaks many tests because they allocate an origin circuit but do not initialize pubsub for it.

Either we setup that pubsub for all tests all the time or we make it that tests can publish messages for an unconfigured pubsub? Or <insert option>?

For now, I'm leaning towards "pubsubs setup at all time for all tests" since initializing a new origin circuit is very basic use case in tests and shouldn't require us to do extra work.

comment:4 in reply to:  3 Changed 2 months ago by catalyst

Replying to dgoulet:

For now, I'm leaning towards "pubsubs setup at all time for all tests" since initializing a new origin circuit is very basic use case in tests and shouldn't require us to do extra work.

I think I was planning to have the general test setup configure pubsub, but Nick talked me out of it. I'll have to dig around for details.

comment:5 Changed 2 months ago by nickm

(I'm afraid I don't remember the original arguments here either. It may be that I was wrong before, or that the original reasoning no longer applies.)

comment:6 Changed 2 months ago by nickm

Keywords: 042-deferred-20190918 added
Milestone: Tor: 0.4.2.x-finalTor: unspecified

Deferring various tickets from 0.4.2 to Unspecified.

Note: See TracTickets for help on using tickets.