Ask Your Question

Segmentation fault calling is_irreducible()

asked 2021-04-16 20:10:00 +0200

daira gravatar image
sage: R.<X> = PolynomialRing(GF(17^2))
sage: (X^2).is_irreducible()
SignalError                               Traceback (most recent call last)
<ipython-input-143-f9ef3e37d5e5> in <module>
----> 1 (X**Integer(2)).is_irreducible()
/usr/lib/python3/dist-packages/sage/rings/polynomial/polynomial_zz_pex.pyx in sage.rings.polynomial.polynomial_zz_pex.Polynomial_ZZ_pEX.is_irreducible (build/cythonized/sage/rings/polynomial/polynomial_zz_pex.cpp:16857)()
    350         self._parent._modulus.restore()
    351         if algorithm=="fast_when_false":
--> 352             sig_on()
    353             res = ZZ_pEX_IterIrredTest(self.x)
    354             sig_off()

SignalError: Segmentation fault
sage: version()
'SageMath version 9.2, Release Date: 2020-10-24'
edit retag flag offensive close merge delete


Welcome to Ask Sage! Thanks for your question.

slelievre gravatar imageslelievre ( 2021-04-17 00:59:37 +0200 )edit

Not seeing this on macOS with SageMah 9.3.rc2, nor on SageCell currently at Sage 9.2.

What operating system? How was Sage installed?

slelievre gravatar imageslelievre ( 2021-04-17 00:59:42 +0200 )edit

Debian Buster, installed using sudo apt-get install sagemath.

It's not reproducible in Sage compiled from source:

│ SageMath version 9.2, Release Date: 2020-10-24                     │
│ Using Python 3.8.5. Type "help()" for help.                        │
sage: R.<X> = PolynomialRing(GF(17^2))                                                                                                           
sage: (X^2).is_irreducible()                                                                                                                     

I guess there's something broken about the Debian package or the libraries it uses.

daira gravatar imagedaira ( 2021-04-17 09:53:30 +0200 )edit

The OS-packaged sage is using Python 3.9.2, if that helps. Anything I can do to help debug the package?

daira gravatar imagedaira ( 2021-04-17 10:04:52 +0200 )edit

Correction: I actually installed from testing; see comment below.

daira gravatar imagedaira ( 2021-04-18 11:51:19 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2021-04-17 18:12:25 +0200

vdelecroix gravatar image

updated 2021-04-17 20:09:58 +0200

(I made this an answer because characters are limited in comments)

NOTE: As Samuel made me remark buster should install 8.6. That is to say your segfault does not seem to be related to the sagemath package in buster. How did you launch Sage? Could you try $ which sage?

I can not reproduce the segmentation fault in docker (after pulling the buster image and installing sagemath from apt). Note that the version they ship is 8.6 which is quite old and you did not run this version. One possibility is that you have libraries that you installed manually (eg in /usr/local) that create some undesired interactions. To check linking from sage you could do $ ldd /usr/lib/python2.7/dist-packages/sage/rings/polynomial/ In docker I got

root@4fddb061c7b8:/# ldd /usr/lib/python2.7/dist-packages/sage/rings/polynomial/ (0x00007ffc67395000) => /usr/lib/ (0x00007fc925346000) => /usr/lib/x86_64-linux-gnu/ (0x00007fc9252c3000) => /usr/lib/x86_64-linux-gnu/ (0x00007fc92513f000) => /usr/lib/x86_64-linux-gnu/ (0x00007fc924826000) => /lib/x86_64-linux-gnu/ (0x00007fc9246a3000) => /lib/x86_64-linux-gnu/ (0x00007fc924689000) => /lib/x86_64-linux-gnu/ (0x00007fc924666000) => /lib/x86_64-linux-gnu/ (0x00007fc9244a5000) => /usr/lib/x86_64-linux-gnu/ (0x00007fc924297000)
    /lib64/ (0x00007fc9257bf000) => /lib/x86_64-linux-gnu/ (0x00007fc924292000)
edit flag offensive delete link more


Question and comments mention SageMath version 9.2 using Python 3.9.2.

slelievre gravatar imageslelievre ( 2021-04-17 19:12:15 +0200 )edit

In buster apt-get install sagemath installs 8.6.

vdelecroix gravatar imagevdelecroix ( 2021-04-17 20:07:25 +0200 )edit

It seems I installed sagemath from testing (i.e. apt-get install -t testing sagemath). Sorry for the confusion. I realize this is not a recommended method of installation.

daira gravatar imagedaira ( 2021-04-18 11:50:02 +0200 )edit

$ ldd /usr/lib/python3/dist-packages/sage/rings/polynomial/ (0x00007fff5c3ed000) => /usr/lib/x86_64-linux-gnu/ (0x00007f204c4b8000) => /usr/lib/x86_64-linux-gnu/ (0x00007f204c2eb000) => /lib/x86_64-linux-gnu/ (0x00007f204c2d1000) => /lib/x86_64-linux-gnu/ (0x00007f204c10e000) => /usr/lib/x86_64-linux-gnu/ (0x00007f204c08d000) => /usr/lib/x86_64-linux-gnu/ (0x00007f204c07d000) => /lib/x86_64-linux-gnu/ (0x00007f204c05a000) => /lib/x86_64-linux-gnu/ (0x00007f204bf15000)
/lib64/ (0x00007f204c7cd000)
daira gravatar imagedaira ( 2021-04-18 12:04:01 +0200 )edit

After taking the step to install from testing, why not go a step further and install from source?

I would suggest installing the latest development version (currently SageMath 9.3.rc4).

slelievre gravatar imageslelievre ( 2021-04-18 17:18:20 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2021-04-16 20:10:00 +0200

Seen: 362 times

Last updated: Apr 17 '21