Skip to content

unable to load extension modules compiled with pypy v7.0.0 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ilsawa opened this issue Feb 9, 2019 · 3 comments
Closed

unable to load extension modules compiled with pypy v7.0.0 #7

ilsawa opened this issue Feb 9, 2019 · 3 comments

Comments

@ilsawa
Copy link

ilsawa commented Feb 9, 2019

I compile this module pypy v7.0.0

pypy setup.py install --record files.txt

When working, I get the following error:


Error while requesting best block header:
Traceback (most recent call last):
  File "/usr/local/lib/pypy2.7/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/local/lib/pypy2.7/dist-packages/twisted/internet/defer.py", line 1475, in gotResult
    _inlineCallbacks(r, g, status)
  File "/usr/local/lib/pypy2.7/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/local/lib/pypy2.7/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
--- <exception caught here> ---
  File "/opt/lyra2re3/p2pool-vtc/p2pool/util/deferral.py", line 41, in f
    result = yield func(*args, **kwargs)
  File "/usr/local/lib/pypy2.7/dist-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/opt/lyra2re3/p2pool-vtc/p2pool/node.py", line 218, in poll_header
    handle_header((yield self.factory.conn.value.get_block_header(self.bitcoind_work.value['previous_block'])))
  File "/opt/lyra2re3/p2pool-vtc/p2pool/node.py", line 200, in handle_header
    if not (self.net.PARENT.POW_FUNC(bitcoin_data.block_header_type.pack(new_header)) <= self.bitcoind_work.value['bits'].target):
  File "/opt/lyra2re3/p2pool-vtc/p2pool/bitcoin/networks/vertcoin.py", line 17, in <lambda>
    POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('lyra2re3_hash').getPoWHash(data))
  File "/usr/local/lib/pypy2.7/dist-packages/lyra2re2_hash-1.2.1-py2.7-linux-x86_64.egg/lyra2re3_hash.py", line 7, in <module>
    __bootstrap__()
  File "/usr/local/lib/pypy2.7/dist-packages/lyra2re2_hash-1.2.1-py2.7-linux-x86_64.egg/lyra2re3_hash.py", line 6, in __bootstrap__
    imp.load_dynamic(__name__,__file__)
exceptions.ImportError: unable to load extension module '/usr/local/lib/pypy2.7/dist-packages/lyra2re2_hash-1.2.1-py2.7-linux-x86_64.egg/lyra2re3_hash.pypy-41-x86_64-linux-gnu.so': /usr/local/lib/pypy2.7/dist-packages/lyra2re2_hash-1.2.1-py2.7-linux-x86_64.egg/lyra2re3_hash.pypy-41-x86_64-linux-gnu.so: undefined symbol: _Py_Dealloc

2

@metalicjames
Copy link
Owner

metalicjames commented Feb 10, 2019

I am not familiar with PyPy but _Py_Dealloc comes from libpython2.7.a with CPython.

@ilsawa
Copy link
Author

ilsawa commented Feb 10, 2019

It is a pity that you do not use, now almost all nodes of p2ool work on PyPy. It is much more efficient than a Python.
Here a similar problem has been solved: dgrunwald/rust-cpython#122 (comment)
But I do not know how to apply it to your sources.

@ilsawa
Copy link
Author

ilsawa commented Feb 10, 2019

Found how to fix it, there's no error now.
I replaced https://github.com/metalicjames/lyra2re-hash-python/blob/master/setup.py#L1 with from distutils.core import setup Extension , and it helped.
But after this replacement, the modules are installed in /usr/local/lib/pypy2.7/dist-packages and not in a separate directory
default

@ilsawa ilsawa closed this as completed Feb 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants