Comments (3)
I can reproduce the issue with python 3.7. Looking into the stacktrace:
Program received signal SIGSEGV, Segmentation fault. [53/866]
0x00000000004d1e7a in PyObject_ClearWeakRefs (object=object@entry=0x7ffff68e8eb8) at ../Objects/weakrefobject.c:899 899 ../Objects/weakrefobject.c: No such file or directory. (gdb) bt #0 0x00000000004d1e7a in PyObject_ClearWeakRefs (object=object@entry=0x7ffff68e8eb8) at ../Objects/weakrefobject.c:899 #1 0x0000000000446991 in func_dealloc (op=op@entry=0x7ffff68e8eb8) at ../Objects/funcobject.c:531 #2 0x0000000000469a59 in _Py_Dealloc (op=0x7ffff68e8eb8) at ../Objects/object.c:1971
#3 0x00000000004e8e16 in call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>)
at ../Python/ceval.c:4629
#4 _PyEval_EvalFrameDefault (f=0x928a08, throwflag=<optimized out>) at ../Python/ceval.c:3124
#5 0x00000000004dda6a in PyEval_EvalFrameEx (f=f@entry=0x928a08, throwflag=throwflag@entry=0) at ../Python/ceval.c:547
#6 0x00000000004de488 in _PyEval_EvalCodeWithName (_co=0x7ffff7238400, globals=<optimized out>, locals=<optimized out>,
args=<optimized out>, argcount=argcount@entry=0, kwnames=0x0, kwargs=0x0, kwcount=0, kwstep=2, defs=0x0, defcount=0,
kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0) at ../Python/ceval.c:3930
#7 0x00000000004de5f2 in PyEval_EvalCodeEx (_co=_co@entry=0x7ffff7238400, globals=globals@entry=0x7ffff72ca148,
locals=locals@entry=0x7ffff72ca148, args=args@entry=0x0, argcount=argcount@entry=0, kws=kws@entry=0x0, kwcount=0,
defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at ../Python/ceval.c:3959
#8 0x00000000004de620 in PyEval_EvalCode (co=co@entry=0x7ffff7238400, globals=globals@entry=0x7ffff72ca148,
locals=locals@entry=0x7ffff72ca148) at ../Python/ceval.c:524
#9 0x0000000000519a99 in run_mod (mod=mod@entry=0x96ae60, filename=filename@entry=0x7ffff7202a50,
globals=globals@entry=0x7ffff72ca148, locals=locals@entry=0x7ffff72ca148, flags=flags@entry=0x7fffffffe41c,
arena=arena@entry=0x7ffff726a4c0) at ../Python/pythonrun.c:1035
#10 0x000000000051c6ab in PyRun_FileExFlags (fp=fp@entry=0x9541b0,
filename_str=filename_str@entry=0x7ffff72a1190 "issue318.py", start=start@entry=257,
globals=globals@entry=0x7ffff72ca148, locals=locals@entry=0x7ffff72ca148, closeit=closeit@entry=1,
flags=0x7fffffffe41c) at ../Python/pythonrun.c:988
#11 0x000000000051ca10 in PyRun_SimpleFileExFlags (fp=fp@entry=0x9541b0, filename=<optimized out>,
filename@entry=0x7ffff72a1190 "issue318.py", closeit=closeit@entry=1, flags=flags@entry=0x7fffffffe41c)
at ../Python/pythonrun.c:429
#12 0x000000000051cbdf in PyRun_AnyFileExFlags (fp=fp@entry=0x9541b0, filename=0x7ffff72a1190 "issue318.py",
closeit=closeit@entry=1, flags=flags@entry=0x7fffffffe41c) at ../Python/pythonrun.c:84
#13 0x0000000000425daa in pymain_run_file (fp=0x9541b0, filename=0x8d98d0 L"issue318.py", p_cf=p_cf@entry=0x7fffffffe41c)
at ../Modules/main.c:427
#14 0x0000000000425e6a in pymain_run_filename (pymain=pymain@entry=0x7fffffffe440, cf=cf@entry=0x7fffffffe41c)
at ../Modules/main.c:1627
#15 0x0000000000425f77 in pymain_run_python (pymain=pymain@entry=0x7fffffffe440) at ../Modules/main.c:2877
#16 0x0000000000429571 in pymain_main (pymain=pymain@entry=0x7fffffffe440) at ../Modules/main.c:3038
#17 0x0000000000429654 in _Py_UnixMain (argc=<optimized out>, argv=<optimized out>) at ../Modules/main.c:3073
#18 0x0000000000422e5b in main (argc=<optimized out>, argv=<optimized out>) at ../Programs/python.c:15
Which is weird - it looks more like a python bug than memory corruption or a segfault in the C lib.
I also tried to repro it with python2.7 and python3.9 - both worked fine. So my conclusion is that we're triggering some CPython bug in some way (your experiment to use a set instead of a list also confirms this).
A few things you can try:
- You don't really need the output from
set_parameters()
, any reason you're using a list comprehension? - Using a for loop instead of the list also avoids the problem.
- Can you try upgrading your Python install?
from python-iptables.
Will try the latest 3.7 and also 3.8 to see if the issue is there. But since 18.04 is widely used (LTS), should we do something about this?
from python-iptables.
This is the first time this issue is reported, so I'm unsure how common it is. It's also limited what we can do, unfortunately: I was poking around yesterday to see if tweaking gc might make a difference, but it does not seem so.
I'll keep this on my radar in case someone else also bumps into it. Thanks for reporting it!
from python-iptables.
Related Issues (20)
- Double free on _Buffer destruction HOT 4
- iptables and iptables-legacy with Docker containers HOT 2
- Rules added via iptc - not found in iptables o/p HOT 5
- iptc has problem when working with syslog module.
- iptc.errors.XTablesError: can't find target response on iptc.easy.dump_table('filter', ipv6=False) and others
- Can't find target JOOL_SIIT when iptables for both ipv4 and ipv6 are used HOT 1
- A question please, not an issue
- cannot use protocol "all"
- Empty rule list returned on Rocky8 HOT 3
- ldconfig packaged in glibc-2.28 has a different out out than ldconfig in glibc-2.17
- Can I use python-iptables on Python 3.6? HOT 1
- Match_set invalid value b'ipset_name' HOT 8
- How to set match LOCAL HOT 4
- --random parameter not working with SNAT HOT 5
- is nftable not supported? HOT 1
- can't dump rules
- Is it possible to create '! --dports' rule?
- iptc/ip4tc.py:261: SyntaxWarning: invalid escape sequence '\s'
- Segfault on None or 'None' for dport extension
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-iptables.