SIGSEGV on rt-prune-step, v1.3.7 and git HEAD

Ondrej Zajicek santiago at crfreenet.org
Sat Apr 7 14:40:35 CEST 2012


On Thu, Apr 05, 2012 at 01:22:11PM -0300, Henrique de Moraes Holschuh wrote:
> I am trying to build a bit more advanced border router here capable of uRPF.
> For that reason, each eBGP peer gets its own kernel table, and bird is used
> to feed RST_BGP, RTS_STATIC and RTS_DEVICE routes to these supplementary
> tables, instead of messing with the "main" kernel routing table.
> 
> Well, the Linux kernel syncer is not very sturdy ATM: it is prone to leaving
> behind some routes (which are correctly annotated as proto bird) when you
> set it to "persist 0".  

Are these routes left behind exactly the ones from RTS_DEVICE protocol?
There is an obsure and probably historic condition in
krt_flush_routes() that disallows removing these ones. You could replace
this (in sysdep/unix/krt.c, krt_flush_routes()) :

          if ((n->n.flags & KRF_INSTALLED) &&
                        a->source != RTS_DEVICE && a->source != RTS_INHERIT)

with just this:

          if (n->n.flags & KRF_INSTALLED)

I will probably merge thes change soon.

> And it also segfaults...
> It segfaults both in v1.3.7 and git HEAD, so it is not a bug in the new
> "batched" route flushing code.

During which operation it segfaults? Is the segfault reproductible in
some situation? What binary do you use, some special compile variants?
Could you get 'core' file and send it to me together with the unstripped
binary and the config file?

Are you sure that the bug appears in plain version 1.3.7 (i saw "v1.3.7
incorrectly tagged in git repository" e-mail, or perhaps some switched
binaries)?

> Here's gdb output for git HEAD (standard hardened Debian build of bird):
> 
> Starting program: /usr/sbin/bird -c /etc/bird/bird.conf -d -D /tmp/debug -u
> bird -g birdctl
> [Thread debugging using libthread_db enabled]
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x000055555555d816 in rt_prune_step (max_feed=<optimized out>,
> tab=<optimized out>) at ../../nest/rt-table.c:958
> 958     ../../nest/rt-table.c: No such file or directory.
>         in ../../nest/rt-table.c
> 
> line 958 of nest/rt-table.c tries to reference e->sender, which apparently
> can be NULL (whether it *should* be NULL I don't know):

Definitely shouldn't.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20120407/5c74844a/attachment-0001.asc>


More information about the Bird-users mailing list