sagemath / cysignals

cysignals: interrupt and signal handling for Cython. Source repository for https://pypi.org/project/cysignals/
GNU Lesser General Public License v3.0
43 stars 23 forks source link

undefined symbol 'PARI_SIGINT_block' on OpenBSD #148

Closed dimpase closed 3 years ago

dimpase commented 3 years ago

On OpenBSD 6.9, cysignals builds, but cannot be imported:

$ ./sage --python
Python 3.8.8 (default, Apr 19 2021, 10:23:47) 
[Clang 10.0.1 ] on openbsd6
Type "help", "copyright", "credits" or "license" for more information.
>>> import cysignals
python3:/home/dima/sagetrac-mirror/local/lib/python3.8/site-packages/cysignals/signals.cpython-38.so: undefined symbol 'PARI_SIGINT_block'
python3:/home/dima/sagetrac-mirror/local/lib/python3.8/site-packages/cysignals/signals.cpython-38.so: undefined symbol 'PARI_SIGINT_pending'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dima/sagetrac-mirror/local/lib/python3.8/site-packages/cysignals/__init__.py", line 1, in <module>
    from .signals import AlarmInterrupt, SignalError, init_cysignals  # noqa
ImportError: Cannot load specified object

indeed, the names of these symbols are a bit weird:

 nm -D /home/dima/sagetrac-mirror/local/lib/libpari-tls.so.7 | grep PARI
000ed1d0 R __emutls_t.PARI_stack_limit
00c42f70 D __emutls_v.PARI_SIGINT_block
00c42f90 D __emutls_v.PARI_SIGINT_pending
00c42fd0 D __emutls_v.PARI_stack_limit

as opposed to Linux:

$ nm -D /usr/lib64/libpari-gmp-tls.so.7 | grep PARI
0000000000000744 B PARI_SIGINT_block
0000000000000740 B PARI_SIGINT_pending
0000000000000730 B PARI_stack_limit

So the hacks (/* Fake PARI variables */) in src/cysignals/implementation.c dealing with PARI_SIGINT_ vars apparently fail.

Any idea how this can be fixed?

dimpase commented 3 years ago

oops, sorry for noise, it's a problem with Pari headers, nothing serious.