Segfault with ifname filter and RTD_UNREACHABLE
Lars Gierth
larsg at systemli.org
Fri Nov 14 18:33:13 CET 2025
Hi all,
I'm migrating a bigger Babel network from Bird 2.17.x to 3.1.x. This is
on OpenWrt snapshot x86_64 with latest Bird stable-v3.1 branch. Shortly
after starting Bird, it segfaults.
I tested all the individual filter statements in my config and confirmed
it's those comparing against ifname, e.g.:
if ifname = "ts_wg0" then
It doesn't segfault if I first check for unreachable:
if dest != RTD_UNREACHABLE && ifname = "ts_wg0" then
The docs state that ifname returns an empty string for sink routes, and
that's what worked for us in 2.17.x, but maybe that broke somehow?
Anyway, with this workaround I can continue testing and rolling out.
Here's the backtrace. The config is attached and binary+coredump can be
downloaded here:
https://github.com/user-attachments/files/23552707/bird-coredump.zip Let
me know if the coredump is broken, gdb did say "memory read failed".
#0 0x00007ffff7fabd80 in ?? ()
#1 0x000000000041f881 in val_same (v1=v1 at entry=0x7fffffffdb90,
v2=0x7fffffffdba8) at filter/data.c:281
#2 0x0000000000415bd7 in interpret (line=<optimized out>,
argc=argc at entry=0, argv=argv at entry=0x0, resc=resc at entry=0,
resv=resv at entry=0x0, fs=<optimized out>) at filter/f-inst.c:453
#3 0x000000000041efb6 in f_run_args (filter=0x7ffff7f31300,
rte=rte at entry=0x7fffffffe8c0, argc=argc at entry=0, argv=argv at entry=0x0,
flags=flags at entry=0) at filter/filter.c:232
#4 0x000000000041f01b in f_run (filter=<optimized out>,
rte=rte at entry=0x7fffffffe8c0, flags=flags at entry=0) at filter/filter.c:215
#5 0x000000000045c328 in channel_rte_import
(c=c at entry=0x7ffff7e61830, n=n at entry=0x7ffff7df6ea8,
new=new at entry=0x7fffffffe8c0, src=0x7ffff7e6e1c0) at nest/rt-table.c:2348
#6 0x000000000046468f in babel_rte_update_unreachable
(p=p at entry=0x7ffff7e61440, e=e at entry=0x7ffff7df6e30,
announce=announce at entry=1 '\001') at proto/babel/babel.c:698
#7 0x0000000000466c7c in babel_rt_notify (c=<optimized out>,
old=<optimized out>, P=0x7ffff7e61440, net=<optimized out>, new=0x0) at
proto/babel/babel.c:2516
#8 babel_rt_notify (P=0x7ffff7e61440, c=<optimized out>,
net=<optimized out>, new=0x0, old=<optimized out>) at
proto/babel/babel.c:2408
#9 0x00000000004581b7 in rt_notify_basic
(c=c at entry=0x7ffff7e61830, new=new at entry=0x0,
old=old at entry=0x7ffff7d983b8) at nest/rt-table.c:1250
#10 0x00000000004593ab in channel_notify_basic
(_channel=0x7ffff7e61830) at nest/rt-table.c:1661
#11 0x000000000043459b in ev_run_list_limited (l=0x53d860
<global_work_list>, limit=9, limit at entry=10) at lib/event.c:338
#12 0x00000000004a7f5d in io_loop () at sysdep/unix/io.c:2640
#13 0x00000000004037d7 in main (argc=<optimized out>,
argv=<optimized out>) at sysdep/unix/main.c:1106
Cheers, and thanks for your work!
Lars
Freifunk Berlin
-------------- next part --------------
log syslog all;
#debug protocols {states};
# Include additional bird config files for runtime extendability
# This is currently empty and not used.
include "/dev/shm/bird_*.conf";
#master4 is implicitly created
ipv6 sadr table v6_main;
ipv4 table v4_babel_ff;
ipv4 table v4_babel_default;
protocol device {
};
protocol direct {
ipv6 sadr {
table v6_main;
};
ipv4;
}
protocol babel {
randomize router id yes;
ipv6 sadr {
table v6_main;
# Import only /56 location aggregates and default routes
import filter {
if ! (net.len = 56 || net = ::/0 from 2001:bf7::/32) then reject;
if ifname = "eth0.20" then {
babel_metric = babel_metric + 512;
}
if ifname = "ts_wg0" then {
babel_metric = babel_metric + 3072;
}
accept;
};
export filter {
if net = 2001:bf7:750:5500::/56 from ::/0 then accept;
if source = RTS_BABEL then accept;
reject;
};
};
ipv4 {
import filter {
if ifname = "eth0.20" then {
babel_metric = babel_metric + 512;
}
if ifname = "ts_wg0" then {
babel_metric = babel_metric + 3072;
}
accept;
};
export where source = RTS_BABEL || net ~ [ 10.0.0.0/8{21,32} ]; # Readvertise learned routes and advertise local networks from 10/8
};
# Mesh interfaces
interface "eth0.20" {
type wireless;
};
# Tunnel interfaces provided by tunspace
interface "ts_wg0" {
type wireless;
};
}
protocol kernel {
ipv6 sadr {
table v6_main;
import all;
export all;
};
learn all; # Allow learning loopback route
}
# Currently not in use but keep for later purposes
protocol kernel {
ipv4 {
import none;
export none;
};
}
# TODO: Get rid of the following when OLSRD is gone
protocol kernel {
kernel table 10;
ipv4 {
table v4_babel_ff;
import none;
export all;
};
}
protocol pipe {
table master4;
peer table v4_babel_ff;
export where net != 0.0.0.0/0;
}
protocol kernel {
kernel table 11;
ipv4 {
table v4_babel_default;
import none;
export all;
};
}
protocol pipe {
table master4;
peer table v4_babel_default;
export where net = 0.0.0.0/0;
}
More information about the Bird-users
mailing list