Bug 1576671

Summary: Sagemath does not compile in Fedora 28
Product: [Fedora] Fedora Reporter: artal
Component: sagemathAssignee: Paulo Andrade <paulo.cesar.pereira.de.andrade>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: artal, aspronedario, cstratak, paulo.cesar.pereira.de.andrade
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-29 11:53:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description artal 2018-05-10 06:31:35 UTC
Description of problem: Trying to compile sagemath (http://www.sagemath.org) from sources (both 8.2 version and develop git branch) fails. Using fedora gcc-8, there are issues with the packages python2 and python3. It is possible to use gcc-7.2 from sagemath to compile, having success with python2, but the same error with python3


Version-Release number of selected component (if applicable):


How reproducible: Always


Steps to Reproduce:
1. Download sage-8.2.tar.gz from sagemath site
2. Follow the instructions to build it, using their own gcc
3.

Actual results: python3 package fails to build with a dumped core when importing crypt module


Expected results: Success


Additional info: The error is common for an upgraded or a fresh installation of Fedora 28.

Comment 1 artal 2018-05-10 07:45:08 UTC
This is output from gdb:

       Message: Process 28762 (python) of user 1000 dumped core.
                
                Stack trace of thread 28762:
                #0  0x00007fcabcc2cc81 __strlen_avx2 (libc.so.6)
                #1  0x00007fcabd9dd158 do_mkvalue (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #2  0x00007fcabd9dda2e va_build_value (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #3  0x00007fcabd9ddaee Py_BuildValue (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #4  0x00007fcab5e0a801 crypt_crypt_impl (_crypt.cpython-36m-x86_64-linux-gnu.so)
                #5  0x00007fcabd925ed5 _PyCFunction_FastCallDict (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #6  0x00007fcabd9b1f3f call_function (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #7  0x00007fcabd9b564f _PyEval_EvalFrameDefault (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #8  0x00007fcabd9b1b3a _PyEval_EvalCodeWithName (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #9  0x00007fcabd9b1dd2 fast_function (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #10 0x00007fcabd9b564f _PyEval_EvalFrameDefault (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #11 0x00007fcabd9b1b3a _PyEval_EvalCodeWithName (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #12 0x00007fcabd9b218f PyEval_EvalCodeEx (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #13 0x00007fcabd9b21bb PyEval_EvalCode (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #14 0x00007fcabd9af19d builtin_exec_impl (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #15 0x00007fcabd926085 PyCFunction_Call (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #16 0x00007fcabd9b9098 do_call_core (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #17 0x00007fcabd9b1b3a _PyEval_EvalCodeWithName (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #18 0x00007fcabd9b1dd2 fast_function (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #19 0x00007fcabd9b564f _PyEval_EvalFrameDefault (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #20 0x00007fcabd9b2139 _PyFunction_FastCall (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #21 0x00007fcabd9b564f _PyEval_EvalFrameDefault (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #22 0x00007fcabd9b2139 _PyFunction_FastCall (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #23 0x00007fcabd9b564f _PyEval_EvalFrameDefault (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #24 0x00007fcabd9b2139 _PyFunction_FastCall (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #25 0x00007fcabd9b564f _PyEval_EvalFrameDefault (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #26 0x00007fcabd9ba77f _PyFunction_FastCall (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #27 0x00007fcabd8be76e _PyObject_FastCallDict (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #28 0x00007fcabd8bf844 _PyObject_CallMethodIdObjArgs (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #29 0x00007fcabd9d4781 PyImport_ImportModuleLevelObject (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #30 0x00007fcabd9b9515 import_name (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #31 0x00007fcabd9b1b3a _PyEval_EvalCodeWithName (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #32 0x00007fcabd9b218f PyEval_EvalCodeEx (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #33 0x00007fcabd9b21bb PyEval_EvalCode (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #34 0x00007fcabd9e572f run_mod (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #35 0x00007fcabd9e57ab PyRun_SimpleStringFlags (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #36 0x00007fcabda03e06 run_command (/usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/libpython3.6m.so.1.0)
                #37 0x0000000000400a8e main (python)
                #38 0x00007fcabcaf31bb __libc_start_main (libc.so.6)
                #39 0x0000000000400b4a _start (python)

GNU gdb (GDB) Fedora 8.1-11.fc28
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/local/sagegit/local/var/tmp/sage/build/python3-3.6.1.p1/src/python...done.
[New LWP 28762]

warning: .dynamic section for "/usr/lib64/libpython3.6m.so.1.0" is not at the expected address (wrong library or version mismatch?)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `./python -c import crypt'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62
62              VPCMPEQ (%rdi), %ymm0, %ymm1

Comment 2 Dario Asprone 2018-05-18 05:16:30 UTC
The only problem in any way attributable to Fedora 28 is the python 3.6.1 error, the python 2 one and the linbox one (which you encounter once the python 3 error is fixed) are due to the new gcc 8 compiler, and are SageMath bugs.
See https://trac.sagemath.org/ticket/25391 for a complete fix (albeit the python 3 fix is more of a workaround).

Comment 3 artal 2018-05-18 16:36:19 UTC
(In reply to Dario Asprone from comment #2)
> The only problem in any way attributable to Fedora 28 is the python 3.6.1
> error, the python 2 one and the linbox one (which you encounter once the
> python 3 error is fixed) are due to the new gcc 8 compiler, and are SageMath
> bugs.
> See https://trac.sagemath.org/ticket/25391 for a complete fix (albeit the
> python 3 fix is more of a workaround).

Applying your patches, everything is OK.

Comment 4 Charalampos Stratakis 2018-08-28 18:19:21 UTC
Downloading sagemath 8.3 tarball which includes the aforementioned fixes on a F28 machine now and invoking 'make python2' or 'make python3', it compiles successfully.

Could you verify it so the bug can be closed?

Comment 5 artal 2018-08-29 07:54:33 UTC
Even the beta versions compile perfectly now with 'make build'. For me, it can be closed.