# Tor keeps crashing [Solved]

## svantoviit

I encounter an issue with the latest Tor: net-misc/tor 0.2.4.5_alpha(bufferevents -nat-pmp -selinux -stats -threads -tor-hardening -transparent-proxy -upnp -web).

It starts without any problems, works fine for a while, but then crashes suddenly.

```
$ rc-status -s

 tor                                                               [  crashed  ]

```

Same after a restart: 

```
# /etc/init.d/tor restart 

 * Stopping Tor ...

 * start-stop-daemon: no matching processes found                         [ ok ]

 * Tor configuration (/etc/tor/torrc) is valid.

 * Starting Tor ...                                                       [ ok ]

```

```
# /etc/init.d/tor status 

 * status: started

```

…and after a while: 

```
# /etc/init.d/tor status 

 * status: crashed

```

/var/log/messages

```
Oct 30 06:52:32 localhost Tor[11507]: Parsing GEOIP file /usr/share/tor/geoip.

Oct 30 06:52:45 localhost Tor[11507]: We now have enough directory information to build circuits.

Oct 30 06:52:45 localhost Tor[11507]: Bootstrapped 80%: Connecting to the Tor network.

Oct 30 06:52:46 localhost Tor[11507]: Bootstrapped 85%: Finishing handshake with first hop.

Oct 30 06:52:46 localhost Tor[11507]: Bootstrapped 90%: Establishing a Tor circuit.

Oct 30 06:52:47 localhost Tor[11507]: Tor has successfully opened a circuit. Looks like client functionality is working.

Oct 30 06:52:47 localhost Tor[11507]: Bootstrapped 100%: Done.

Oct 30 06:56:55 localhost Tor[11507]: channel_closed(): Bug: src/or/channel.c:1315: channel_closed: Assertion chan->state == CHANNEL_STATE_CLOSING || chan->state == CHANNEL_STATE_CLOSED || chan->state == CHANNEL_STATE_ERROR failed; aborting.
```

Wasn't able to find a reason, nor a solution.Last edited by svantoviit on Sat Dec 22, 2012 8:00 am; edited 1 time in total

----------

## audiodef

Can you post your /etc/tor/torrc?

----------

## svantoviit

The config is the default, minimal one: 

```
#

# Minimal torrc so tor will work out of the box

#

User tor

PIDFile /var/run/tor/tor.pid

Log notice syslog

DataDirectory /var/lib/tor/data
```

Tried to increase the log verbosity to debug, but couldn't find more info on the error: 

```
Oct 30 10:19:11 localhost Tor[13663]: channel_queue_cell(): Directly handling incoming cell_t 0x7fff0dccfd40 for channel 0x1b5c640 (global ID 3)

Oct 30 10:19:11 localhost Tor[13663]: circuit_get_by_circid_channel_impl(): circuit_get_by_circid_channel_impl() returning circuit 0x1c00310 for circ_id 43062, channel ID 3 (0x1b5c640)

Oct 30 10:19:11 localhost Tor[13663]: relay_lookup_conn(): found conn for stream 22043.

Oct 30 10:19:11 localhost Tor[13663]: circuit_receive_relay_cell(): Sending to origin.

Oct 30 10:19:11 localhost Tor[13663]: connection_edge_process_relay_cell(): Now seen 944 relay cells here (command 2, stream 22043).

Oct 30 10:19:11 localhost Tor[13663]: connection_edge_process_relay_cell(): circ deliver_window now 991.

Oct 30 10:19:11 localhost Tor[13663]: connection_or_process_cells_from_inbuf(): 12: starting, inbuf_datalen 0 (0 pending in tls object).

Oct 30 10:19:15 localhost Tor[13663]: connection_mark_for_close_(): Calling connection_mark_for_close on an OR conn at src/or/connection.c:3080

Oct 30 10:19:16 localhost Tor[13663]: conn_close_if_marked(): Cleaning up connection (fd -1).

Oct 30 10:19:16 localhost Tor[13663]: channel_closed(): Bug: src/or/channel.c:1315: channel_closed: Assertion chan->state == CHANNEL_STATE_CLOSING || chan->state == CHANNEL_STATE_CLOSED || chan->state == CHANNEL_STATE_ERROR failed; aborting.

```

----------

## Gentoo64

I get exactly the same error. Default config too.

----------

## khayyam

svantoviit, Gentoo64 ...

CHANNEL_STATE is normally associated with fair queuing, or DMA, is CONFIG_WAN, CONFIG_WAN_ROUTER or CONFIG_NET_SCHED ("QoS and/or fair queueing") enabled in the kernel?

It might be an idea to provide some info re ethernet/network card, .config, etc. 

Also, is any ulimit (ie: rc_ulimit="-n 30000") value given in /etc/conf.d/tor?

best ... khay

----------

## stickstoff

I had the same problems too with tor-0.2.4.4_alpha and with net-misc/tor-0.2.4.5_alpha.

There's nothing special in /etc/tor/torrc, except from logging settings.

The kernel option CONFIG_NET_SCHED is indeed enabled here, while CONFIG_WAN, CONFIG_WAN_ROUTER aren't set.

The default rc_ulimit="-n 30000" is in /etc/conf.d/tor.

The only solution for me so far was to downgrade to net-misc/tor-0.2.3.24_rc, which works again.

----------

## svantoviit

Thanks for the replies.

```
CONFIG_NET_DMA=y

CONFIG_WAN_ROUTER=m

CONFIG_WAN=y

CONFIG_NET_SCHED=y
```

don't think there should be a problem, neither in the network card.

/etc/conf.d/tor: rc_ulimit="-n 30000" nothing strange there either.

I'll try to downgrade so far…

Edit:

Just for the record, 0.2.3.24_rc works without any issues.

@ExecutorElassus: The time after 0.2.4.5_alpha crashes is absolutely random.Last edited by svantoviit on Thu Nov 01, 2012 9:09 am; edited 1 time in total

----------

## ExecutorElassus

This started for me as well right after the most recent upgrade of libproxy, which I'm given to understand from some bug reports is having problems with subversion.

My tor daemon shuts down after exactly one hour of operation, leading me to believe it's something to do with resetting connections and failing.

Can anybody else having this issue please check the times when their tor client shuts down?

Cheers,

EE

----------

## stickstoff

Hi ExecutorElassus,

for me, the connection closed almost immediately after tor's bootstrapping was done.

Here's some of my tor.log with output from 0.2.4.5-alpha and 0.2.4.4-alpha:

```
Oct 30 20:12:36.000 [notice] Tor 0.2.4.5-alpha (git-17a6aa56cefe9d83) opening log file.

...

Oct 30 20:12:41.000 [notice] Bootstrapped 100%: Done.

Oct 30 21:05:56.000 [err] channel_closed(): Bug: src/or/channel.c:1315: channel_closed: Assertion chan->state == CHANNEL_STATE_CLOSING || chan->state == CHANNEL_STATE_CLOSED || chan->state == CHANNEL_STATE_ERROR failed; aborting.

Oct 31 01:52:56.000 [notice] Tor 0.2.4.5-alpha (git-17a6aa56cefe9d83) opening log file.

...

Oct 31 01:53:00.000 [notice] Bootstrapped 100%: Done.

Oct 31 01:54:03.000 [err] channel_closed(): Bug: src/or/channel.c:1315: channel_closed: Assertion chan->state == CHANNEL_STATE_CLOSING || chan->state == CHANNEL_STATE_CLOSED || chan->state == CHANNEL_STATE_ERROR failed; aborting.

Oct 31 11:47:23.000 [notice] Tor 0.2.4.5-alpha (git-17a6aa56cefe9d83) opening log file.

...

Oct 31 11:47:29.000 [notice] Bootstrapped 100%: Done.

Oct 31 11:47:56.000 [err] channel_closed(): Bug: src/or/channel.c:1315: channel_closed: Assertion chan->state == CHANNEL_STATE_CLOSING || chan->state == CHANNEL_STATE_CLOSED || chan->state == CHANNEL_STATE_ERROR failed; aborting.

Oct 31 11:52:11.000 [notice] Tor 0.2.4.4-alpha (git-fe3b95f359619427) opening log file.

...

Oct 31 11:52:15.000 [notice] Bootstrapped 100%: Done.

Oct 31 11:53:16.000 [err] channel_closed(): Bug: src/or/channel.c:1313: channel_closed: Assertion chan->state == CHANNEL_STATE_CLOSING || chan->state == CHANNEL_STATE_CLOSED || chan->state == CHANNEL_STATE_ERROR failed; aborting.
```

Cheers,

stickstoff

----------

## mfinkel

This is a known bug, there's an open ticket at [1]. If you can grab a stack trace from it, that would be awesome! If you get one but prefer not to create an account, there's a pseudonym cypherpunks you may use.

[1] https://trac.torproject.org/projects/tor/ticket/7267

----------

## svantoviit

Upgraded to 0.2.4.6_alpha and it works fine. Solved for me.

----------

