On Fri, Feb 17, 2017 at 09:06:55AM +0200, Lennert Buytenhek wrote:
Hello!
I work with João and I managed to cut our (huge) config down to a minimal reproducer. Our setup does something like this:
Hi Thanks for trying to track the problem.
There seems to be a problem related to the memory management of strings used in per static route implicit filter expressions when a reconfiguration happens.
Does the problem disappear if you replace strings with numbers in your test case?
The crash goes away if I apply this patch (not the right fix, I'm sure):
=== diff --git a/proto/static/static.c b/proto/static/static.c index 0c088cd..a56771f 100644 --- a/proto/static/static.c +++ b/proto/static/static.c @@ -498,7 +498,8 @@ static_same_dest(struct static_route *x, struct static_route *y) static inline int static_same_rte(struct static_route *x, struct static_route *y) { - return static_same_dest(x, y) && i_same(x->cmds, y->cmds); +// return static_same_dest(x, y) && i_same(x->cmds, y->cmds); + return 0; }
===
I think that the reconfiguration code finds the old and the new implicit filter expression to be the same code, and therefore hangs onto the old version, but then the underlying memory for some of the old objects gets freed. Or something like that.
Well, the comparison in static_same_rte() is just for decision whether the route should be propagated again to the (main) routing table. Internal structures of static protocols (like struct static_route) are replaced anyways. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@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."