Ask Your Question
3

Segmentation fault calling is_irreducible()

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

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

Comments

Welcome to Ask Sage! Thanks for your question.

slelievre gravatar imageslelievre ( 2021-04-17 00:59:37 +0100 )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 +0100 )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()                                                                                                                     
False

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

daira gravatar imagedaira ( 2021-04-17 09:53:30 +0100 )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 +0100 )edit

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

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

1 Answer

Sort by » oldest newest most voted
0

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

vdelecroix gravatar image

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

(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/polynomial_zz_pex.x86_64-linux-gnu.so. In docker I got

root@4fddb061c7b8:/# ldd /usr/lib/python2.7/dist-packages/sage/rings/polynomial/polynomial_zz_pex.x86_64-linux-gnu.so  
    linux-vdso.so.1 (0x00007ffc67395000)
    libntl.so.35 => /usr/lib/libntl.so.35 (0x00007fc925346000)
    libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fc9252c3000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc92513f000)
    libpari-gmp-tls.so.6 => /usr/lib/x86_64-linux-gnu/libpari-gmp-tls.so.6 (0x00007fc924826000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc9246a3000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc924689000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc924666000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc9244a5000)
    libgf2x.so.1 => /usr/lib/x86_64-linux-gnu/libgf2x.so.1 (0x00007fc924297000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fc9257bf000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc924292000)
edit flag offensive delete link more

Comments

Question and comments mention SageMath version 9.2 using Python 3.9.2.

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

In buster apt-get install sagemath installs 8.6.

vdelecroix gravatar imagevdelecroix ( 2021-04-17 20:07:25 +0100 )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 +0100 )edit

$ ldd /usr/lib/python3/dist-packages/sage/rings/polynomial/polynomial_zz_pex.cpython-39-x86_64-linux-gnu.so

linux-vdso.so.1 (0x00007fff5c3ed000)
libntl.so.43 => /usr/lib/x86_64-linux-gnu/libntl.so.43 (0x00007f204c4b8000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f204c2eb000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f204c2d1000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f204c10e000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f204c08d000)
libgf2x.so.3 => /usr/lib/x86_64-linux-gnu/libgf2x.so.3 (0x00007f204c07d000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f204c05a000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f204bf15000)
/lib64/ld-linux-x86-64.so.2 (0x00007f204c7cd000)
daira gravatar imagedaira ( 2021-04-18 12:04:01 +0100 )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 +0100 )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

Stats

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

Seen: 458 times

Last updated: Apr 17 '21