Tor segfaults on saveconf if it can't read its torrc file

Hi, in a very weird edge case a controller issuing a saveconf request can terminate Tor. I just reproed this with... Tor v0.2.3.1-alpha-dev (git-e6980fae)

Repro steps:

  1. Start tor with an open control port
  2. Chown the torrc to root so the tor user lacks read/write permissions
  3. Issue a SAVECONF request
  4. Tor crashes with... May 10 18:25:39.000 [warn] Could not open "/home/atagar/.tor/torrc": Permission denied Segmentation fault

The permissions on the torrc during the crash... -rw------- 1 root atagar 274 2011-05-10 10:01 .tor/torrc

Here's the quick method for issuing the saveconf request via torctl:

>>> from TorCtl import TorCtl
>>> conn = TorCtl.connect()
>>> conn.sendAndRecv("SAVECONF\r\n")

Cheers! -Damian