Re: [RFC]Routes are stored as a linked list
Donald Sharp
Mon Mar 04 01:06:45 2019
Roy -
Just a normal startup w/ your rbtree branch:
harpd@janelle ~/d/src> sudo gdb ./dhcpcd
GNU gdb (Debian 8.2.1-1) 8.2.1
Copyright (C) 2018 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 "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./dhcpcd...done.
(gdb) r
Starting program: /home/sharpd/dhcpcd/src/dhcpcd
main: control_open: Connection refused
main: mkdir `/var/db/dhcpcd': No such file or directory
[Detaching after vfork from child process 27525]
script_runreason: /libexec/dhcpcd-run-hooks: No such file or directory
[Detaching after vfork from child process 27526]
script_runreason: /libexec/dhcpcd-run-hooks: No such file or directory
[Detaching after vfork from child process 27527]
script_runreason: /libexec/dhcpcd-run-hooks: No such file or directory
[Detaching after vfork from child process 27528]
script_runreason: /libexec/dhcpcd-run-hooks: No such file or directory
[Detaching after vfork from child process 27529]
script_runreason: /libexec/dhcpcd-run-hooks: No such file or directory
[Detaching after vfork from child process 27530]
script_runreason: /libexec/dhcpcd-run-hooks: No such file or directory
/var/db/dhcpcd/duid: No such file or directory
DUID 00:03:00:01:2a:6e:64:8a:fe:b6
dummy0: IAID 64:8a:fe:b6
Program received signal SIGSEGV, Segmentation fault.
0x0000aaaaaaabdb04 in rt_recvrt (cmd=cmd@entry=1,
rt=rt@entry=0xffffffffad60) at route.c:345
345 ctx = rt->rt_ifp->ctx;
(gdb)
(gdb) p rt->rt_ifp
$1 = (struct interface *) 0x0
(gdb) p rt
$2 = (const struct rt *) 0xffffffffad60
(gdb) p *rt
$3 = {rt_ss_dest = {sa = {sa_family = 0, sa_data = '\000' <repeats 13
times>}, sin = {sin_family = 0, sin_port = 0, sin_addr = {s_addr = 0},
sin_zero = "\000\000\000\000\000\000\000"}, sin6 = {sin6_family
= 0, sin6_port = 0, sin6_flowinfo = 0, sin6_addr = {__in6_u = {
__u6_addr8 =
"\000\000\000\000\000\000\000\000\n\000\000\000\000\000\000",
__u6_addr16 = {0, 0, 0, 0, 10, 0, 0, 0}, __u6_addr32 = {0,
0, 10, 0}}}, sin6_scope_id = 0}}, rt_ss_netmask = {sa =
{sa_family = 0,
sa_data =
"\000\000\000\000\000\000\000\000\000\001\000\000\000"}, sin =
{sin_family = 0, sin_port = 0, sin_addr = {s_addr = 0},
sin_zero = "\000\000\000\001\000\000\000"}, sin6 = {sin6_family
= 0, sin6_port = 0, sin6_flowinfo = 0, sin6_addr = {__in6_u = {
__u6_addr8 =
"\000\000\000\001\000\000\000\000\n\000\000\000\000\000\000",
__u6_addr16 = {0, 256, 0, 0, 10, 0, 0, 0}, __u6_addr32 = {
16777216, 0, 10, 0}}}, sin6_scope_id = 4294967295}},
rt_ss_gateway = {sa = {sa_family = 65535,
sa_data =
"\377\377\377\377\377\377\377\377\377\377\000\000\000"}, sin =
{sin_family = 65535, sin_port = 65535, sin_addr = {
s_addr = 4294967295}, sin_zero =
"\377\377\377\377\000\000\000"}, sin6 = {sin6_family = 65535,
sin6_port = 65535,
sin6_flowinfo = 4294967295, sin6_addr = {__in6_u = {__u6_addr8 =
"\377\377\377\377", '\000' <repeats 11 times>, __u6_addr16 = {65535,
65535, 0, 0, 0, 0, 0, 0}, __u6_addr32 = {4294967295, 0, 0,
0}}}, sin6_scope_id = 0}}, rt_ifp = 0x0, rt_ss_ifa = {sa = {
sa_family = 0, sa_data =
"\000\000\000\000\000\000\020o\261\252\252\252\000"}, sin =
{sin_family = 0, sin_port = 0, sin_addr = {
s_addr = 0}, sin_zero = "\020o\261\252\252\252\000"}, sin6 =
{sin6_family = 0, sin6_port = 0, sin6_flowinfo = 0, sin6_addr =
{__in6_u = {
__u6_addr8 =
"\020o\261\252\252\252\000\000\000\000\000\000\000\000\000",
__u6_addr16 = {28432, 43697, 43690, 0, 0, 0, 0, 0},
__u6_addr32 = {2863755024, 43690, 0, 0}}}, sin6_scope_id =
0}}, rt_flags = 0, rt_mtu = 0, rt_metric = 0, rt_dflags = 0, rt_tree =
{
rb_nodes = {0x10000000000, 0x1}, rb_info = 281474976689840}}
(gdb)
donald
On Sun, Mar 3, 2019 at 6:56 PM Roy Marples <roy@xxxxxxxxxxxx> wrote:
>
> On 03/03/2019 21:22, Roy Marples wrote:
> > I'll look into adding some portability gunk so this can compile on Linux
> > at least, again, sometime next week. Probably before I look at the
> > frrouting.
>
> Gunk added.
> Works on Linux - and valgrind reports no memory leaks.
> I suspect the issue on your patch is the route comparison as I had to
> add some extra stuff there.
>
> Works on FreeBSD as well, but segfaults on OpenBSD - I need to look into
> that.
>
> Sadly I accidently had IPv4LL support compiled out, so the binary size
> is now sadly a growth of 1k and memory usage is marginally higher.
>
> To save me some time, could you checkout the rbtree branch and test
> performance and memory usage with your thousands of routes please? Would
> be good to compare to the OpenBSD variant you did.
>
> Thanks
>
> Roy
Archive administrator: postmaster@marples.name