#27489 closed defect (fixed)

*** SIG 14 *** outside sig_on

Reported by: vbraun Owned by:
Priority: major Milestone: sage-8.7
Component: doctest coverage Keywords:
Cc: jdemeyer Merged in:
Authors: Jeroen Demeyer Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: 16e5233 (Commits) Commit: 16e52334c7124c30c913e49082daeb86a826bc63
Dependencies: Stopgaps:

Description

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]

Change History (5)

comment:1 Changed 11 months ago by jdemeyer

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

comment:2 Changed 11 months ago by jdemeyer

  • Branch set to u/jdemeyer/____sig_14_____outside_sig_on

comment:3 Changed 11 months ago by jdemeyer

  • Authors set to Jeroen Demeyer
  • Commit set to 16e52334c7124c30c913e49082daeb86a826bc63
  • Component changed from packages: standard to doctest coverage
  • Status changed from new to needs_review

New commits:

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

comment:4 Changed 11 months ago by vbraun

  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

comment:5 Changed 11 months ago by vbraun

  • Branch changed from u/jdemeyer/____sig_14_____outside_sig_on to 16e52334c7124c30c913e49082daeb86a826bc63
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.