Oct 10 23:23:01.238 [notice] Bootstrapped 90%: Establishing a Tor circuit.Oct 10 23:23:10.342 [notice] Self-testing indicates your ORPort is reachable from the outside. Excellent. Publishing server descriptor.Oct 10 23:23:10.632 [warn] tor_addr_is_internal(): Bug: tor_addr_is_internal() called with a non-IP address of type 0Oct 10 23:23:10.821 [warn] tor_addr_is_internal(): Bug: tor_addr_is_internal() called with a non-IP address of type 0Oct 10 23:23:11.009 [err] channel_change_state(): Bug: src/or/channel.c:1913: channel_change_state: Assertion !(chan->incoming_queue) || smartlist_len(chan->incoming_queue) == 0 failed; aborting.src/or/channel.c:1913 channel_change_state: Assertion !(chan->incoming_queue) || smartlist_len(chan->incoming_queue) == 0 failed; aborting.
The tor_addr_is_internal bug lines appear to be begindir requests:
Oct 10 23:23:10.819 [info] connection_exit_connect_dir(): Opening local connection for anonymized directory exitOct 10 23:23:10.821 [warn] tor_addr_is_internal(): Bug: tor_addr_is_internal() called with a non-IP address of type 0Oct 10 23:23:10.821 [info] _connection_free(): Freeing linked Directory connection [writing] with 0 bytes on inbuf, 0 on outbuf.
I'm working on getting a traceback, but the PIE stuff makes it hard.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related.
Learn more.
#0 0x00007fb6c6bde1b5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64#1 0x00007fb6c6be0fc0 in *__GI_abort () at abort.c:92#2 0x0000000000465f5b in channel_change_state (chan=0x616cd60, to_state=CHANNEL_STATE_CLOSED) at src/or/channel.c:1823#3 0x00000000004a90bb in connection_or_about_to_close (or_conn=0x616ceb0) at src/or/connection_or.c:599#4 0x000000000040b82d in connection_unlink (conn=0x2b59) at src/or/main.c:384#5 0x000000000040ba98 in conn_close_if_marked () at src/or/main.c:931#6 close_closeable_connections () at src/or/main.c:701#7 0x000000000040cb18 in run_scheduled_events (timer=<value optimized out>, arg=<value optimized out>) at src/or/main.c:1534#8 second_elapsed_callback (timer=<value optimized out>, arg=<value optimized out>) at src/or/main.c:1690#9 0x00007fb6c7917344 in event_base_loop () from /usr/lib/libevent-1.4.so.2#10 0x000000000040a021 in do_main_loop () at src/or/main.c:1986#11 0x000000000040a35d in tor_main (argc=<value optimized out>, argv=0x7fff2003e038) at src/or/main.c:2694#12 0x00007fb6c6bcac8d in __libc_start_main (main=<value optimized out>, argc=<value optimized out>, ubp_av=<value optimized out>, init=<value optimized out>, fini=<value optimized out>, rtld_fini=<value optimized out>, stack_end=0x7fff2003e028) at libc-start.c:228#13 0x0000000000408809 in _start ()
That's not the same assertion you reported the first time, I think. The first assertion was at line 1913; this is at 1823 apparently? Or are the line numbers messed up?
Okay, I think I understand this one now. There are three places new channels get created: from circuitbuild.c in channel_connect_for_circuit(), which then immediately calls command_setup_channel() on them; incoming connections from a channel listener get passed to the handler, command_handle_incoming_channel() in command.c, which does the same. The other case is dirserv reachability testing dirserv_single_reachability_test() of dirserv.c, which doesn't install incoming cell handlers. Whoops! The channel gets a cell from the remote end that stays stuck forever and then closes with a non-empty queue.
Obvious fix: make it call command_setup_channel() too so those channels route cells to the right place. Query, though: if no handlers are available to drain the queue when closing the channel, is asserting in the case that it has leftover cells the right thing?
A user on IRC reported the tor_addr_is_internal() thing yesterday happening in a release before this; it might not be athena's code. A stack trace would help!
I added 8586611718ee9c4cc81eb8fe50c937619393ade6 to try to help track down the tor_addr_is_internal() issue. It will add the filename and line number of the calling function to the log message.
Okay, it's in a directory connection, and finding that conn->addr is unassigned. It's a connection that we accepted, since we are calling write_http_response_header.
But looking at connection_handler_listener_read(), I don't see how it can ever generate a directory connection that doesn't have conn->addr set -- the tor_addr_copy() on connection.c line 1254 seems pretty convincing.
Are we sure this didn't come from begindir? I guess it doesn't look that way from the call chain, or from the way that it's including an X-Descriptor-Not-New header.
It could be useful to see the output of 'print *conn' in write_http_response_header_impl.
So, two options seem to be to always set addr on linked connections ("What could go wrong"?), or to look at the linked connection's address when deciding whether to report conn->_base.address in an X-Your-Address-Is header.
So, two options seem to be to always set addr on linked connections ("What could go wrong"?), or to look at the linked connection's address when deciding whether to report conn->_base.address in an X-Your-Address-Is header.
I haven't been paying enough attention. Where did the bug get introduced?