Opened 4 years ago

Closed 4 years ago

#9746 closed defect (fixed)

Recent regression during sighup with owned process

Reported by: atagar Owned by:
Priority: High Milestone: Tor: 0.2.5.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-client regression
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Hi Nick. After much head scratching I've come up with a repro for the recent burst of stem integ test failures we got after your big push on 9/13. The issue seems to manifest when tor is started with OwningControllerProcess then given a sighup...

atagar@odin:~/Desktop/tor/tor$ cat torrc 
DataDirectory /tmp/my_data

atagar@odin:~/Desktop/tor/tor$ cat demo.sh 
tor -f torrc __OwningControllerProcess $$ &
sleep 10
pkill -sighup tor
sleep 60

atagar@odin:~/Desktop/tor/tor$ ./demo.sh 
Sep 14 14:53:03.180 [notice] Tor v0.2.5.0-alpha-dev (git-147a0f31bd72cfd2) running on Linux with Libevent 2.0.16-stable, OpenSSL 1.0.1 and Zlib 1.2.3.4.
Sep 14 14:53:03.180 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Sep 14 14:53:03.180 [notice] This version is not a stable Tor release. Expect more bugs than usual.
Sep 14 14:53:03.180 [notice] Read configuration file "/home/atagar/Desktop/tor/tor/torrc".
Sep 14 14:53:03.184 [notice] Opening Socks listener on 127.0.0.1:9050
Sep 14 14:53:03.000 [notice] We now have enough directory information to build circuits.
Sep 14 14:53:03.000 [notice] Bootstrapped 80%: Connecting to the Tor network.
Sep 14 14:53:04.000 [notice] Bootstrapped 85%: Finishing handshake with first hop.
Sep 14 14:53:05.000 [notice] Bootstrapped 90%: Establishing a Tor circuit.
Sep 14 14:53:06.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Sep 14 14:53:06.000 [notice] Bootstrapped 100%: Done.
Sep 14 14:53:13.000 [notice] Received reload signal (hup). Reloading config and resetting internal state.
Sep 14 14:53:13.000 [notice] Configuration file "/usr/local/etc/tor/torrc" not present, using reasonable defaults.
Sep 14 14:53:13.000 [warn] Failed to parse/validate config: While Tor is running, changing DataDirectory ("/tmp/my_data"->"/home/atagar/.tor") is not allowed.
Sep 14 14:53:13.000 [err] Reading config failed--see warnings above. For usage, try -h.
Sep 14 14:53:13.000 [warn] Restart failed (config error?). Exiting.

The issue looks to be that the HUP changes the torrc it loads from the argument provided via -f (./torrc) to its default (/usr/local/etc/tor/torrc).

Cheers! -Damian

Child Tickets

Change History (3)

comment:1 Changed 4 years ago by nickm

  • Keywords tor-client regression added
  • Milestone set to Tor: 0.2.5.x-final

Charming. It doesn't have to be OwningControllerProcess, though: If you start with any option on the command line other than -f, you seem to get this behavior. Investigating.

comment:2 Changed 4 years ago by nickm

There -- 15b9a1ff10b6892e0cfa should fix it. That was a fun one.

comment:3 Changed 4 years ago by nickm

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.