Opened 4 years ago

Closed 4 years ago

Last modified 16 months ago

#10465 closed defect (fixed)

tor_assertion_failed_(): Bug: src/or/connection_edge.c:1176: connection_ap_handshake_rewrite_and_attach: Assertion !automap failed; aborting.

Reported by: epoch Owned by:
Priority: High Milestone: Tor: 0.2.4.x-final
Component: Core Tor/Tor Version: Tor: 0.2.4.18-rc
Severity: Keywords: assert, automap, tor-resolve, 2016-bug-retrospective
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Caused when doing tor-resolve on a domain with a TLD that is automapped.

Dec 22 04:03:19.000 [err] tor_assertion_failed_(): Bug: src/or/connection_edge.c:1176: connection_ap_handshake_rewrite_and_attach: Assertion !automap failed; aborting.
Dec 22 04:03:19.000 [err] Bug: Assertion !automap failed in connection_ap_handshake_rewrite_and_attach at src/or/connection_edge.c:1176. Stack trace:
Dec 22 04:03:19.000 [err] Bug: tor(log_backtrace+0x44) [0xb7710214]
Dec 22 04:03:19.000 [err] Bug: tor(tor_assertion_failed_+0xdf) [0xb771dfbf]
Dec 22 04:03:19.000 [err] Bug: tor(connection_ap_handshake_rewrite_and_attach+0x7ce) [0xb76c1d1e]
Dec 22 04:03:19.000 [err] Bug: tor(connection_edge_process_inbuf+0x2a0) [0xb76c3020]
Dec 22 04:03:19.000 [err] Bug: tor(+0xc92ae) [0xb76b32ae]
Dec 22 04:03:19.000 [err] Bug: tor(connection_handle_read+0x597) [0xb76b9027]
Dec 22 04:03:19.000 [err] Bug: tor(+0x2d301) [0xb7617301]
Dec 22 04:03:19.000 [err] Bug: /usr/lib/i386-linux-gnu/libevent-2.0.so.5(event_base_loop+0x3c2) [0xb7537522]
Dec 22 04:03:19.000 [err] Bug: tor(do_main_loop+0x1bf) [0xb7617caf]
Dec 22 04:03:19.000 [err] Bug: tor(tor_main+0xd95) [0xb761a2e5]
Dec 22 04:03:19.000 [err] Bug: tor(main+0x33) [0xb7614043]
Dec 22 04:03:19.000 [err] Bug: /lib/i386-linux-gnu/i686/cmov/libc.so.6(libc_start_main+0xe6) [0xb71b7e46]
Dec 22 04:03:19.000 [err] Bug: tor(+0x2a08d) [0xb761408d]

Child Tickets

Change History (14)

comment:1 Changed 4 years ago by cypherpunks

It happens if addressmap_register_virtual_address() returns address for RESOLVED_TYPE_IPV6. Another code of connection_ap_handshake_rewrite_and_attach() is not ready to handle such address, like this case where

if (tor_inet_aton(socks->address, &in)) { /* see if it's an IP already */

is not true.

comment:2 Changed 4 years ago by cypherpunks

Milestone: Tor: 0.2.5.x-finalTor: 0.2.4.x-final
Priority: normalmajor
Version: Tor: 0.2.5.1-alphaTor: 0.2.4.18-rc

Right now default IPv6 for prefer_ipv6_virtaddr breaks DNSPort functional with using AutomapHostsOnResolve. It's broken for 0.2.4.x.

comment:3 Changed 4 years ago by nickm

Status: newneeds_review

Fix in branch "bug10465" works for me. Please review?

comment:4 Changed 4 years ago by cypherpunks

How it works for DNSPort? Why need to answer AAAA for every request? Request for A answer for AAAA?

comment:5 Changed 4 years ago by cypherpunks

Wrong comment. Delete.

Last edited 4 years ago by cypherpunks (previous) (diff)

comment:6 Changed 4 years ago by nickm

Hm. I'm trying to reproduce the bug with DNSPort, and getting strangeness.

I started Tor with "./src/or/tor -dnsport '9999 preferipv6automap' -automaphostsonresolve 1 -automaphostssuffix . "

Then I did:

[619]$ dig @localhost -p 9999 aaaa www.torproject.org

; <<>> DiG 9.8.3-P1 <<>> @localhost -p 9999 aaaa www.torproject.org
; (3 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45384
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.torproject.org.		IN	AAAA

;; ANSWER SECTION:
www.torproject.org.	60	IN	A	127.237.144.204

;; Query time: 0 msec
;; SERVER: 127.0.0.1#9999(127.0.0.1)
;; WHEN: Sun Dec 22 09:19:54 2013
;; MSG SIZE  rcvd: 52

and

[621]$ dig @localhost -p 9999 example.com

; <<>> DiG 9.8.3-P1 <<>> @localhost -p 9999 example.com
; (3 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18398
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;example.com.			IN	A

;; ANSWER SECTION:
example.com.		60	IN	A	127.201.101.133

;; Query time: 0 msec
;; SERVER: 127.0.0.1#9999(127.0.0.1)
;; WHEN: Sun Dec 22 09:20:31 2013
;; MSG SIZE  rcvd: 45

I'm not seeing the behavior where it answers AAAA for every request. In fact, it seems to be sending A even if it was asked for an AAAA.

How do I reproduce the behavior that you are talking about?

comment:7 Changed 4 years ago by nickm

(afk for a number of hours; I'll check again once I get back home)

comment:8 Changed 4 years ago by cypherpunks

Sorry it was wrong comments. All flags is clear, so no crash. But no AAAA answer even if asked. Still neeed to check flags so answered correctly.

comment:9 Changed 4 years ago by cypherpunks

I think "bug10465" is ok for 0.2.4.x, as dns stuff more complex and not only about AutomapHostsOnResolve case.

comment:10 Changed 4 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Merged into 0.2.4, opening #10468 for the DNSPort issue.

comment:11 Changed 4 years ago by nickm

(The commit I merged differs from the one in my public repo: It has a complete comment for the new function, not an unfinished one.)

comment:12 Changed 16 months ago by nickm

Keywords: 2016-bug-retrospective added

Mark bugs for 2016 bug retrospective based on hand-examination of changelogs for 0.2.5 onwards.

comment:13 Changed 16 months ago by nickm

Mark bugs for 2016 bug retrospective based on hand-examination of changelogs for 0.2.5 onwards.

comment:14 Changed 16 months ago by nickm

Mark bugs for 2016 bug retrospective based on hand-examination of changelogs for 0.2.5 onwards.

Note: See TracTickets for help on using tickets.