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

*** SIG 14 *** outside sig_on #27489

Closed
vbraun opened this issue Mar 15, 2019 · 7 comments
Closed

*** SIG 14 *** outside sig_on #27489

vbraun opened this issue Mar 15, 2019 · 7 comments

Comments

@vbraun
Copy link
Member

vbraun commented Mar 15, 2019

This is with cysignals 1.10.2 and SAGE_DEBUG:

File "src/sage/interfaces/expect.py", line 1177, in sage.interfaces.expect.Expect._expect_expr
Failed example:
    print(sage0.eval("dummy=gp.eval('0'); alarm(1); gp._expect_expr('1')"))  # long time
Expected:
    Control-C pressed.  Interrupting PARI/GP interpreter. Please wait a few seconds...
    ...
    AlarmInterrupt:
Got:
    *** SIG 14 *** outside sig_on
    do_raise_exception(sig=14)
    PyErr_Occurred() = (nil)
    Raising Python exception 0 ms after signal...
    Control-C pressed. Interrupting PARI/GP interpreter. Please wait a few seconds...
    ---------------------------------------------------------------------------
    AlarmInterrupt                            Traceback (most recent call last)
    <ipython-input-4-842428b726a0> in <module>()
    ----> 1 dummy=gp.eval('0'); alarm(Integer(Integer(Integer(1)))); gp._expect_expr('1')
    <BLANKLINE>
    /mnt/disk/home/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc in _expect_expr(self, expr, timeout)
       1189                 i = self._expect.expect(expr, timeout=timeout)
       1190             else:
    -> 1191                 i = self._expect.expect(expr)
       1192             if i > 0:
       1193                 v = self._before()
    <BLANKLINE>
    /mnt/disk/home/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/pexpect/spawnbase.pyc in expect(self, pattern, timeout, searchwindowsize, async_, **kw)
        339         compiled_pattern_list = self.compile_pattern_list(pattern)
        340         return self.expect_list(compiled_pattern_list,
    --> 341                 timeout, searchwindowsize, async_)
        342 
        343     def expect_list(self, pattern_list, timeout=-1, searchwindowsize=-1,
    <BLANKLINE>
    /mnt/disk/home/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/pexpect/spawnbase.pyc in expect_list(self, pattern_list, timeout, searchwindowsize, async_, **kw)
        367             return expect_async(exp, timeout)
        368         else:
    --> 369             return exp.expect_loop(timeout)
        370 
        371     def expect_exact(self, pattern_list, timeout=-1, searchwindowsize=-1,
    <BLANKLINE>
    /mnt/disk/home/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/pexpect/expect.pyc in expect_loop(self, timeout)
        109                     return self.timeout()
        110                 # Still have time left, so read more data
    --> 111                 incoming = spawn.read_nonblocking(spawn.maxread, timeout)
        112                 if self.spawn.delayafterread is not None:
        113                     time.sleep(self.spawn.delayafterread)
    <BLANKLINE>
    /mnt/disk/home/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/pexpect/pty_spawn.pyc in read_nonblocking(self, size, timeout)
        497         # is available right now. But if a non-zero timeout is given
        498         # (possibly timeout=None), we call select() with a timeout.
    --> 499         if (timeout != 0) and select(timeout):
        500             return super(spawn, self).read_nonblocking(size)
        501 
    <BLANKLINE>
    /mnt/disk/home/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/pexpect/pty_spawn.pyc in select(timeout)
        447         else:
        448             def select(timeout):
    --> 449                 return select_ignore_interrupts([self.child_fd], [], [], timeout)[0]
        450 
        451         # If there is data available to read right now, read as much as
    <BLANKLINE>
    /mnt/disk/home/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/pexpect/utils.pyc in select_ignore_interrupts(iwtd, owtd, ewtd, timeout)
        141     while True:
        142         try:
    --> 143             return select.select(iwtd, owtd, ewtd, timeout)
        144         except InterruptedError:
        145             err = sys.exc_info()[1]
    <BLANKLINE>
    src/cysignals/signals.pyx in cysignals.signals.python_check_interrupt()
    <BLANKLINE>
    AlarmInterrupt:
**********************************************************************
1 item had failures:
   1 of  10 in sage.interfaces.expect.Expect._expect_expr
    [102 tests, 1 failure, 268.38 s]

CC: @jdemeyer

Component: doctest coverage

Author: Jeroen Demeyer

Branch/Commit: 16e5233

Reviewer: Volker Braun

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

@vbraun vbraun added this to the sage-8.7 milestone Mar 15, 2019
@jdemeyer
Copy link

comment:1

Is this a new thing? I think neither that test nor that debug output from cysignals has changed recently.

@jdemeyer
Copy link

@jdemeyer
Copy link

Commit: 16e5233

@jdemeyer
Copy link

Author: Jeroen Demeyer

@jdemeyer
Copy link

New commits:

16e5233Fix alarm() test when cysignals was compiled with debugging

@vbraun
Copy link
Member Author

vbraun commented Mar 15, 2019

Reviewer: Volker Braun

@vbraun
Copy link
Member Author

vbraun commented Mar 16, 2019

Changed branch from u/jdemeyer/____sig_14_____outside_sig_on to 16e5233

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

2 participants