Python bindings crash when more than one Nftables is instantiated
Hello,
it seems to me that this should not be happening. Use case is not as pathological as it may seem: your program may be using different third party modules, each of them instantiate Nftables interface.
$ sudo python [sudo] password for echerkashin: Python 3.9.7 (default, Sep 3 2021, 06:18:44) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
from nftables import Nftables
n1=Nftables()
n2=Nftables()
<Ctrl-D>
double free or corruption (top)
Aborted
Note that it happens on exit (possibly on the second call to __del__()).
nftables v0.9.9
Regards,
Eugene
Pablo Neira Ayuso
maintainerQuoted 15 lines · Eugene Crosser
Hello,
it seems to me that this should not be happening. Use case is not as pathological as it may seem: your program may be using different third party modules, each of them instantiate
Nftablesinterface.$ sudo python [sudo] password for echerkashin: Python 3.9.7 (default, Sep 3 2021, 06:18:44) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
from nftables import Nftables
n1=Nftables()
n2=Nftables()
<Ctrl-D>
Quoted 6 lines
double free or corruption (top)
AbortedNote that it happens on exit (possibly on the second call to
__del__()).nftables v0.9.9
Upstream fix:
http://git.netfilter.org/nftables/commit/?id=b85769f9397c72ab62387ccc5b7a66d0c3ff5f21
Thanks for reporting.