[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

Re: [Openvpn-users] Assertion failed at mroute.c:349


  • Subject: Re: [Openvpn-users] Assertion failed at mroute.c:349
  • From: Paul Mitchell <paul.mitchell@xxxxxxxxxxxxxx>
  • Date: Wed, 03 Aug 2005 10:09:54 +0100


James Yonan wrote:
On Tue, 2 Aug 2005, Erich Titl wrote:


Paul

I looked at the assertion error, it appears to be triggered by a call to
multi_del_iroutes and hence mroute_helper_del_iroute. just before the
assertion net_len_refcount is decremented and thus may become negative.

I believe the following code is not entirely correct and does not
rgenerate the refcount if it becomes zero.

mroute.c:

     if (!mh->net_len_refcount[ir->netbits])
       mroute_helper_regenerate (mh);

IMHO should read

     if (mh->net_len_refcount[ir->netbits] < 1)
       mroute_helper_regenerate (mh);

because this regeneration takes place when the first iroute ets added
too. It may be possible that the regeneration code is not executed in a
previous call to mroute_helper_del_iroute call and thus the refcount
gets decremented below zero in a subsequent call.

James, would you mind to comment on this?


No, that's not the problem.

The code in mroute_helper_{add,del}_iroute is correct.

The assertion is being thrown by design because mroute_helper_del_iroute is being called for a given netbits value, without a corresponding earlier call to mroute_helper_add_iroute for that same netbits value.

Think of it as a test to prevent a double free. Your patch above would allow the double free, and therefore mask the underlying problem which is occuring in the code which calls mroute_helper_{add,del}_iroute.

I've figured out a recipe to reproduce this, and I should have a fix shortly.

James

Thanks James,

If you need anymore information or the patch test let me know directly if you wish.

Do you know what is causing this?

I'm implementing the trouble sum connection on a separate instance of OpenVPN.

Thanks for all your work,

Paul.


Warning: require_once(../../../archive_common.php) [function.require-once]: failed to open stream: No such file or directory in /home/openvpn/domains/openvpn.net/public_html/archive/openvpn-users/2005-08/msg00032.html on line 217

Fatal error: require_once() [function.require]: Failed opening required '../../../archive_common.php' (include_path='/usr/local/lib/php') in /home/openvpn/domains/openvpn.net/public_html/archive/openvpn-users/2005-08/msg00032.html on line 217