On 05/06/19(Wed) 21:40, Alexander Bluhm wrote:
> On Sat, May 25, 2019 at 02:44:02PM -0300, Martin Pieuchot wrote:
> > It looks like a stack exhaustion.
> > Having a non-recursive art_table_walk() might be a solution.
> 
> We see a similar crash on OpenBSD 6.5.  Disabling -msave-args as a
> workaround helps, then it uses less stack.  I guess this is the
> reason why we did not see it with 6.4.

This also certainly happens because art_alloc() is currently configured
to use 32 tables for IPv6.  So iterating on an address can cause up to
32 art_table_walk().  Reducing the depth could work around the issue.

Another way to prevent stack exhaustion would be to return a reference
to any `rt' that needs to be deleted instead of deleting it in place.

Returning a reference implies unwinding the stack.  Since after a
deleting EAGAIN is returned which means the iteration starts from the
beginning it makes sense to unwind the stack first, delete the route,
then start the iteration again.

Reply via email to