Opened 2 months ago

Closed 7 weeks ago

#26948 closed defect (fixed)

tor_run_main crashes when called a second time with --version

Reported by: hellais Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.5.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: 034-backport fast-fix 033-backport
Cc: ahf Actual Points:
Parent ID: #25510 Points:
Reviewer: ahf Sponsor:

Description

I wrote a testing harness that uses python and cffi, to implement some basic smoke tests for libtor. This can be found here: ​https://gist.github.com/hellais/b56043d57eb5be885958e80b3665bfe2 (to run it do pip install cffi and change the LIB_PATH to the correct path).

In particular by adding the command line flag --version and starting tor, I am unable to re-start it due to the exception listed in the above gist.

Child Tickets

Change History (7)

comment:1 Changed 2 months ago by nickm

Keywords: 034-backport fast-fix added
Milestone: Tor: 0.3.5.x-final

comment:2 Changed 8 weeks ago by nickm

Owner: set to nickm
Status: newaccepted

comment:3 Changed 8 weeks ago by nickm

Keywords: 033-backport added
Status: acceptedneeds_review

Okay; the problem here was that some variables weren't getting cleared in the case that we left tor_run_main() early. Bugfix in branch bug26948_033; PR at https://github.com/torproject/tor/pull/255 .

comment:4 Changed 8 weeks ago by hellais

I have testing the branch at tip a67d153cc with the above mentioned script and it works for me:

- running test_get_tor_version()
Tor version 0.3.3.8-dev (git-a67d153cc7493f91).
- running test_get_tor_version_many()
Tor version 0.3.3.8-dev (git-a67d153cc7493f91).
Tor version 0.3.3.8-dev (git-a67d153cc7493f91).
Tor version 0.3.3.8-dev (git-a67d153cc7493f91).
Tor version 0.3.3.8-dev (git-a67d153cc7493f91).
Tor version 0.3.3.8-dev (git-a67d153cc7493f91).
Tor version 0.3.3.8-dev (git-a67d153cc7493f91).
Tor version 0.3.3.8-dev (git-a67d153cc7493f91).
Tor version 0.3.3.8-dev (git-a67d153cc7493f91).
Tor version 0.3.3.8-dev (git-a67d153cc7493f91).
Tor version 0.3.3.8-dev (git-a67d153cc7493f91).

Thanks for fixing this.

Last edited 8 weeks ago by hellais (previous) (diff)

comment:5 Changed 7 weeks ago by asn

Reviewer: ahf

comment:6 Changed 7 weeks ago by ahf

Status: needs_reviewmerge_ready

Neat. LGTM.

comment:7 Changed 7 weeks ago by nickm

Resolution: fixed
Status: merge_readyclosed

merged, I believe!

Note: See TracTickets for help on using tickets.