Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conda-forge-standard: Runtime error in sage.libs.giac #33056

Closed
mkoeppe opened this issue Dec 21, 2021 · 9 comments
Closed

conda-forge-standard: Runtime error in sage.libs.giac #33056

mkoeppe opened this issue Dec 21, 2021 · 9 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 21, 2021

... while docbuilding

[sagemath_doc_html-none] Traceback (most recent call last):
[sagemath_doc_html-none]   File "sage/libs/giac/giac.pyx", line 1121, in sage.libs.giac.giac.Pygen.eval (build/cythonized/sage/libs/giac/giac.cpp:143102)
[sagemath_doc_html-none]     result=GIAC_protecteval(self.gptr[0],giacsettings.eval_level,context_ptr)
[sagemath_doc_html-none]   File "sage/libs/giac/giac.pyx", line 739, in sage.libs.giac.giac.GiacSetting.eval_level.__get__ (build/cythonized/sage/libs/giac/giac.cpp:10554)
[sagemath_doc_html-none]     return (self.cas_setup()[7][3])._val
[sagemath_doc_html-none]   File "sage/libs/giac/giac.pyx", line 1036, in sage.libs.giac.giac.Pygen.__getitem__ (build/cythonized/sage/libs/giac/giac.cpp:142533)
[sagemath_doc_html-none]     ans=Pygen(cmd).eval()
[sagemath_doc_html-none]   File "sage/libs/giac/giac.pyx", line 1125, in sage.libs.giac.giac.Pygen.eval (build/cythonized/sage/libs/giac/giac.cpp:143178)
[sagemath_doc_html-none]     raise RuntimeError
[sagemath_doc_html-none] RuntimeError
[sagemath_doc_html-none] 
[sagemath_doc_html-none] During handling of the above exception, another exception occurred:
[sagemath_doc_html-none] 

(Previously reported in #32087 comment:33)

Also various giac-related errors in doctests.

File "src/sage/functions/other.py", line 1803, in sage.functions.other.Function_prod.__init__
Failed example:
    giac(sprod(m, m, 1, n)).sage()
Exception raised:
    Traceback (most recent call last):
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/expect.py", line 516, in _start
        self._expect.expect(self._prompt)
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/pexpect/spawnbase.py", line 343, in expect
        return self.expect_list(compiled_pattern_list,
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/pexpect/spawnbase.py", line 372, in expect_list
        return exp.expect_loop(timeout)
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/pexpect/expect.py", line 179, in expect_loop
        return self.eof(e)
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/pexpect/expect.py", line 122, in eof
        raise exc
    pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
    Giac with PID 33060 running /opt/conda/bin/giac --sage
    command: /opt/conda/bin/giac
    args: ['/opt/conda/bin/giac', '--sage']
    buffer (last 100 chars): b''
    before (last 100 chars): b'// Maximum number of parallel threads 10\r\nWarning adding 1 ) at end of input\r\n'
    after: <class 'pexpect.exceptions.EOF'>
    match: None
    match_index: None
    exitstatus: None
    flag_eof: True
    pid: 33060
    child_fd: 64
    closed: False
    timeout: None
    delimiter: <class 'pexpect.exceptions.EOF'>
    logfile: None
    logfile_read: None
    logfile_send: None
    maxread: 4194304
    ignorecase: False
    searchwindowsize: None
    delaybeforesend: None
    delayafterclose: 0.1
    delayafterterminate: 0.1
    searcher: searcher_re:
        0: re.compile(b'[0-9]*>> ')

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/expect.py", line 1470, in __init__
        self._name = parent._create(value, name=name)
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/interface.py", line 513, in _create
        self.set(name, value)
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/giac.py", line 666, in set
        out = self.eval(cmd)
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/giac.py", line 650, in eval
        ans = Expect.eval(self, code, strip=strip, **kwds).strip()
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/expect.py", line 1382, in eval
        return '\n'.join([self._eval_line(L, allow_use_file=allow_use_file, **kwds)
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/expect.py", line 1382, in <listcomp>
        return '\n'.join([self._eval_line(L, allow_use_file=allow_use_file, **kwds)
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/giac.py", line 616, in _eval_line
        z = Expect._eval_line(self, line, allow_use_file=allow_use_file,
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/expect.py", line 948, in _eval_line
        self._start()
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/expect.py", line 520, in _start
        raise RuntimeError("unable to start %s: %s" % (self.name(), msg))
    RuntimeError: unable to start giac: End Of File (EOF). Exception style platform.
    Giac with PID 33060 running /opt/conda/bin/giac --sage
    command: /opt/conda/bin/giac
    args: ['/opt/conda/bin/giac', '--sage']
    buffer (last 100 chars): b''
    before (last 100 chars): b'// Maximum number of parallel threads 10\r\nWarning adding 1 ) at end of input\r\n'
    after: <class 'pexpect.exceptions.EOF'>
    match: None
    match_index: None
    exitstatus: None
    flag_eof: True
    pid: 33060
    child_fd: 64
    closed: False
    timeout: None
    delimiter: <class 'pexpect.exceptions.EOF'>
    logfile: None
    logfile_read: None
    logfile_send: None
    maxread: 4194304
    ignorecase: False
    searchwindowsize: None
    delaybeforesend: None
    delayafterclose: 0.1
    delayafterterminate: 0.1
    searcher: searcher_re:
        0: re.compile(b'[0-9]*>> ')

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/doctest/forker.py", line 694, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.functions.other.Function_prod.__init__[5]>", line 1, in <module>
        giac(sprod(m, m, Integer(1), n)).sage()
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/interface.py", line 302, in __call__
        result = self._coerce_from_special_method(x)
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/interface.py", line 330, in _coerce_from_special_method
        return (x.__getattribute__(s))(self)
      File "sage/structure/sage_object.pyx", line 782, in sage.structure.sage_object.SageObject._giac_ (build/cythonized/sage/structure/sage_object.c:7937)
        return self._interface_(G)
      File "sage/symbolic/expression.pyx", line 1204, in sage.symbolic.expression.Expression._interface_ (build/cythonized/sage/symbolic/expression.cpp:35138)
        return super(Expression, self)._interface_(I)
      File "sage/structure/sage_object.pyx", line 694, in sage.structure.sage_object.SageObject._interface_ (build/cythonized/sage/structure/sage_object.c:5783)
        X = I(s)
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/interface.py", line 295, in __call__
        return cls(self, x, name=name)
      File "/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/interfaces/expect.py", line 1475, in __init__
        raise TypeError(*x.args)
    TypeError: unable to start giac: End Of File (EOF). Exception style platform.
    Giac with PID 33060 running /opt/conda/bin/giac --sage
    command: /opt/conda/bin/giac
    args: ['/opt/conda/bin/giac', '--sage']
    buffer (last 100 chars): b''
    before (last 100 chars): b'// Maximum number of parallel threads 10\r\nWarning adding 1 ) at end of input\r\n'
    after: <class 'pexpect.exceptions.EOF'>
    match: None
    match_index: None
    exitstatus: None
    flag_eof: True
    pid: 33060
    child_fd: 64
    closed: False
    timeout: None
    delimiter: <class 'pexpect.exceptions.EOF'>
    logfile: None
    logfile_read: None
    logfile_send: None
    maxread: 4194304
    ignorecase: False
    searchwindowsize: None
    delaybeforesend: None
    delayafterclose: 0.1
    delayafterterminate: 0.1
    searcher: searcher_re:
        0: re.compile(b'[0-9]*>> ')

Upstream: Fixed upstream, in a later stable release.

CC: @isuruf @kiwifb @dimpase @videlec

Component: porting

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/33056

@mkoeppe mkoeppe added this to the sage-9.5 milestone Dec 21, 2021
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@kiwifb
Copy link
Member

kiwifb commented Dec 21, 2021

comment:3

Does giac even start and work on that machine - without going through sage.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Dec 21, 2021

comment:4

No, it looks it's broken

(base) root@a22492f2faa5:/sage# which giac
/opt/conda/bin/giac
(base) root@a22492f2faa5:/sage# giac
// Maximum number of parallel threads 10
Warning adding 1 ) at end of input
Segmentation fault

(This is an image built with tox -e docker-conda-forge-standard)

@kiwifb
Copy link
Member

kiwifb commented Dec 21, 2021

comment:5

OK, that's one suspicion correct from the doctest failure. It is still quite strange, it starts and then breaks down rather than just going straight to segfault. Multiple versions of some libraries trying to load?

@fchapoton
Copy link
Contributor

comment:6

bump to 9.6

@fchapoton fchapoton modified the milestones: sage-9.5, sage-9.6 Jan 29, 2022
@isuruf
Copy link
Member

isuruf commented Feb 16, 2022

Upstream: Fixed upstream, in a later stable release.

@isuruf
Copy link
Member

isuruf commented Feb 16, 2022

comment:7

Fixed in conda-forge/giac-feedstock#28

Giac was storing aide_cas location in the build machine in a C++
string and that failed with conda's relocation helper which only
works with C strings.

Fixed it by using dladdr to get the full path to lib/libgiac.so.0
and reconstructed the path.

@isuruf isuruf removed this from the sage-9.6 milestone Feb 16, 2022
@dimpase
Copy link
Member

dimpase commented Feb 17, 2022

Reviewer: Dima Pasechnik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants