evilsocket / opensnitch

OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch.
GNU General Public License v3.0
10.91k stars 509 forks source link

undefined symbol: PyString_FromStringAndSize #69

Closed robertvalik closed 7 years ago

robertvalik commented 7 years ago

Hello, tried this on Gentoo, emerged all the dependencies, installation goes OK. But I cannot start opensnitch due to an error:

Traceback (most recent call last):
  File "/usr/bin/opensnitch", line 4, in <module>
    __import__('pkg_resources').run_script('opensnitch==0.0.2', 'opensnitch')
  File "/usr/lib64/python3.5/site-packages/pkg_resources/__init__.py", line 738, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib64/python3.5/site-packages/pkg_resources/__init__.py", line 1499, in run_script
    exec(code, namespace, namespace)
  File "/usr/lib64/python3.5/site-packages/opensnitch-0.0.2-py3.5.egg/EGG-INFO/scripts/opensnitch", line 69, in <module>
    from opensnitch.snitch import Snitch
  File "/usr/lib64/python3.5/site-packages/opensnitch-0.0.2-py3.5.egg/opensnitch/snitch.py", line 20, in <module>
    from netfilterqueue import NetfilterQueue
ImportError: /usr/lib64/python3.5/site-packages/NetfilterQueue-0.8.1-py3.5-linux-x86_64.egg/netfilterqueue.cpython-35m-x86_64-linux-gnu.so: undefined symbol: PyString_FromStringAndSize`
adisbladis commented 7 years ago

I cant reproduce this but I do get some interesting compiler warnings from python-netfilterqueue related to this.

@robertvalik Can you try to apply this patch to python-netfilterqueue and see if that fixes it for you? If it does I'm going to send a PR upstream.

gled-rs commented 7 years ago

I can confirm the patch fixes the issue ( I had the same problem on gentoo ).

adisbladis commented 7 years ago

Pull request sent upstream: https://github.com/kti/python-netfilterqueue/pull/32

robertvalik commented 7 years ago

@gled-rs Would you be so kind to help me out - how to apply the patch? What package?

adisbladis commented 7 years ago

@robertvalik You are presumably getting python-netfilterqueue from the Pentoo overlay.

That one is using Portage EAPI 6 which should allow you to apply user patches easily. Here is a good starting point: https://wiki.gentoo.org/wiki//etc/portage/patches#Adding_user_patches

robertvalik commented 7 years ago

@adisbladis Nope, actually, I cannot find any python-netfilterqueue in my portage tree (and overlays). I believe that the setup.py script installed NetfilterQueue. Am I mistaken, should I get the Pentoo overlay and install the pakage from there?

gled-rs commented 7 years ago

I just compiled from the source, applied the patch and installed it from there. Did not used pentoo overlay for that.

robertvalik commented 7 years ago

The NetfilterQueue package was installed using pip. I removed it and installed a patched version. Openstitch starts now. Thanks!