dlundquist / sniproxy

Proxies incoming HTTP and TLS connections based on the hostname contained in the initial request of the TCP session.
BSD 2-Clause "Simplified" License
2.55k stars 397 forks source link

Assertion `address_is_sockaddr(server_address)' failed #142

Closed Stealthii closed 9 years ago

Stealthii commented 9 years ago

SNIProxy randomly fails even during limited / no use. I ran it through gdb to see if I could identify the problem. It took SNIProxy about 2 weeks to fail on this occasion, however in the past, sometimes it's only a couple of hours before it exhibits this error.

root@sniproxy:~# gdb /usr/sbin/sniproxy
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/sbin/sniproxy...Reading symbols from /usr/lib/debug/usr/sbin/sniproxy...done.
done.
(gdb) run -f
Starting program: /usr/sbin/sniproxy -f
sniproxy: connection.c:419: resolve_server_address: Assertion `address_is_sockaddr(server_address)' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff742b165 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) 
Stealthii commented 9 years ago

It is worth mentioning that I am using SNIproxy to provide external access to HTTP/HTTPS on locally addressable machines over multiple subnets. The machine running SNIproxy has 4 interfaces, of which the second is dual stack.

Stealthii commented 9 years ago

SNIProxy would now crash on average once every 2 hours with this error.

dlundquist commented 9 years ago

@Stealthii sorry for the very tardy reply to this issue. I believe this is caused by clients making requests through your instance of sniproxy with IP address literals in the Host header or SNI extension, I've added a restriction blocking this requests: ece963f27.

Stealthii commented 9 years ago

Nice, this does appear to be the issue in testing. I'll close this as I don't see this arising in the current release. Thanks!