Upgrading Sage from 9.2 to 9.3 breaks the LMFDB <http://www.lmfdb.org>
(segfaults on startup).  We believe that the problem arises from an
interaction between Pari and threads, and were able to duplicate it in Sage
with the following:

from concurrent.futures import ThreadPoolExecutor
sage: with ThreadPoolExecutor() as e:
....:     j = e.submit(is_squarefree, 15)
....: j.result()

...
~/sage/sage-9.4.beta0/local/lib/python3.9/site-packages/sage/rings/integer.pyx
in sage.rings.integer.Integer.is_squarefree
(build/cythonized/sage/rings/integer.c:37634)()
   6007             False
   6008         """
-> 6009         return self.__pari__().issquarefree()
   6010
   6011     cpdef __pari__(self):

~/sage/sage-9.4.beta0/local/lib/python3.9/site-packages/sage/rings/integer.pyx
in sage.rings.integer.Integer.__pari__
(build/cythonized/sage/rings/integer.c:37754)()
   6029
   6030         """
-> 6031         return new_gen_from_mpz_t(self.value)
   6032
   6033     def _interface_init_(self, I=None):

~/sage/sage-9.4.beta0/local/lib/python3.9/site-packages/sage/libs/pari/convert_gmp.pyx
in sage.libs.pari.convert_gmp.new_gen_from_mpz_t
(build/cythonized/sage/libs/pari/convert_gmp.c:1298)()
     50         True
     51     """
---> 52     sig_on()
     53     return new_gen(_new_GEN_from_mpz_t(value))
     54

SignalError: Segmentation fault

Searching for cypari issues, #94
<https://github.com/sagemath/cypari2/issues/94> suggests that there may be
a problem with "relatively recent decision of maintaining pointers on the
PARI stack."

At this point, we're a little lost.  We understand that sage overall is not
threadsafe.  But we hope that cypari (and the parts of Sage that we use in
the LMFDB) can be, since it was in 9.2.  Any tips on where to look next (or
fixes to suggest!) would be welcome.
David

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAChs6_nAw%3D7B6yqjFL5A-V%2Bb5gjVUG_%3DipzqYHkUn8Vt0gvkYw%40mail.gmail.com.

Reply via email to