thiezn / iperf3-python

Python wrapper around iperf3
https://iperf3-python.readthedocs.org/
MIT License
110 stars 51 forks source link

segmentationfault on debian 9 #17

Closed illu89 closed 6 years ago

illu89 commented 7 years ago

Hi, i just tried to run iperf3-python on Debian Stetch. (iperf3 (and libiperf) installed from Debian apt repository. iperf3-python installed using pip.)

following code fails

>>> import iperf3
>>> i = iperf3.Server()
Speicherzugriffsfehler

I had a look at the code and found that it fails at line self.lib.iperf_defaults(self._test) in method defaults of class IPerf3. If i try to use libiperf in the same way iperf3-python does, it fails too. Problem seems to be, that the code is not defining restype and argtype properties for the used library functions.

necromuralist commented 7 years ago

I had what might be a related problem using Ubuntu Zesty (iperf 3.1.3):

import iperf3
iperf3.Client()

Crashes the interpreter with this error:

“python test.py” terminated by signal SIGSEGV (Address boundary error)

and the forked branch @illu89 created fixed it. Oddly, I have a raspberry pi 3 with debian stretch (and iperf 3.1.3) and it doesn't have this problem.

kkroo commented 6 years ago

i have the same issue on debian 9. confirmed #18 fixes this

thiezn commented 6 years ago

Hi @illu89, thanks for the pull request. I've incorporated the changes in v0.1.8 (https://github.com/thiezn/iperf3-python/commit/2a6b7f1e24eeda49ba427f6029d7260f27e32b69) with some minor adjustments to the code and tests to ensure compatibility with iperf versions < 3.0.12 due to the json_output not available there in the library.