#9678: Rewrite interrupt handling
------------------------------+---------------------------------------------
   Reporter:  jdemeyer        |       Owner:  jdemeyer                   
       Type:  task            |      Status:  positive_review            
   Priority:  blocker         |   Milestone:  sage-4.7                   
  Component:  c_lib           |    Keywords:  interrupt, error, c, cython
     Author:  Jeroen Demeyer  |    Upstream:  N/A                        
   Reviewer:  Volker Braun    |      Merged:                             
Work_issues:                  |  
------------------------------+---------------------------------------------

Comment(by vbraun):

 I'm trying out Sage-4.6.2.rc0 in Fedora 14 i386 inside `VirtualBox`, and
 it doesn't catch the SIGILL. Bactrace is below. Everything else works
 fine. Also, no such issue on my native Fedora 14 x86_64.

 I'm not sure who is to blame here, could be something with the virtual
 machine. I did write a SIGILL handler in Perl and that works, so
 `VirtualBox` is at least in principle able to have guests raise and handle
 SIGILL. Though there is also some forking involved...

 The only thing thats special about SIGILL that comes to mind is that it
 might not be automatically be reset to SIG_DFL upon entrance. But I don't
 see how that could cause this. Here is my testcase:
 {{{
 [vbraun@localhost ~]$ sage -gdb
 ----------------------------------------------------------------------
 | Sage Version 4.6.2.rc0, Release Date: 2011-02-18                   |
 | Type notebook() for the GUI, and license() for information.        |
 ----------------------------------------------------------------------
 **********************************************************************
 *                                                                    *
 * Warning: this is a prerelease version, and it may be unstable.     *
 *                                                                    *
 **********************************************************************
 /home/vbraun/Sage/sage/local/bin/sage-ipython
 GNU gdb (GDB) Fedora (7.2-41.fc14)
 Copyright (C) 2010 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 "i686-redhat-linux-gnu".
 For bug reporting instructions, please see:
 <http://www.gnu.org/software/gdb/bugs/>...
 Reading symbols from
 /mnt/sage/vbraun/sage-4.6.2.rc0/local/bin/python...done.
 [Thread debugging using libthread_db enabled]
 Python 2.6.4 (r264:75706, Feb 19 2011, 16:56:24)
 [GCC 4.5.1 20100924 (Red Hat 4.5.1-4)] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 Traceback (most recent call last):
   File "/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.14-gdb.py", line
 59, in <module>
     from libstdcxx.v6.printers import register_libstdcxx_printers
   File "/usr/lib/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line
 19, in <module>
     import itertools
 ImportError: No module named itertools
 Detaching after fork from child process 10247.
 }}}
 So far, so good. Now run:
 {{{
 sage: import sage.tests.interrupt
 sage: sage.tests.interrupt.test_signal_ill()
 Detaching after fork from child process 10248.

 Program received signal SIGILL, Illegal instruction.
 0x05dac6b1 in _sig_on_prejmp (__pyx_self=<value optimized out>,
 __pyx_args=0xb7fa702c, __pyx_kwds=0x0) at
 /home/vbraun/Sage/sage/local/include/csage/interrupt.h:192
 192             _signals.sig_on_count++;
 Missing separate debuginfos, use: debuginfo-install
 expat-2.0.1-10.fc13.i686 fontconfig-2.8.0-2.fc14.i686 glibc-2.13-1.i686
 keyutils-libs-1.2-6.fc12.i686 krb5-libs-1.8.2-8.fc14.i686
 libcom_err-1.41.12-6.fc14.i686 libgcc-4.5.1-4.fc14.i686
 libgfortran-4.5.1-4.fc14.i686 libselinux-2.0.96-6.fc14.1.i686
 libstdc++-4.5.1-4.fc14.i686 ncurses-libs-5.7-9.20100703.fc14.i686 nss-
 softokn-freebl-3.12.9-2.fc14.i686 openssl-1.0.0d-1.fc14.i686
 (gdb) l
 187         fprintf(stderr, "sig_on (counter = %i) at %s:%i\n",
 _signals.sig_on_count+1, file, line);
 188         fflush(stderr);
 189     #endif
 190         if (_signals.sig_on_count > 0)
 191         {
 192             _signals.sig_on_count++;
 193             return 1;
 194         }
 195
 196         /* At this point, _signals.sig_on_count == 0 */
 (gdb) bt
 #0  0x05dac6b1 in _sig_on_prejmp (__pyx_self=<value optimized out>,
 __pyx_args=0xb7fa702c, __pyx_kwds=0x0)
     at /home/vbraun/Sage/sage/local/include/csage/interrupt.h:192
 #1  __pyx_pf_4sage_5tests_9interrupt_test_signal_ill (__pyx_self=<value
 optimized out>, __pyx_args=0xb7fa702c, __pyx_kwds=0x0) at
 sage/tests/interrupt.c:2878
 #2  0x0017c398 in PyCFunction_Call (func=0xaad686c, arg=0xb7fa702c,
 kw=0x0) at Objects/methodobject.c:85
 #3  0x001de9dd in call_function (f=0x820c4d4, throwflag=0) at
 Python/ceval.c:3706
 #4  PyEval_EvalFrameEx (f=0x820c4d4, throwflag=0) at Python/ceval.c:2389
 #5  0x001e06e7 in PyEval_EvalCodeEx (co=0xaa5fd58, globals=0x83cf3e4,
 locals=0x83cf3e4, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
 defcount=0,
     closure=0x0) at Python/ceval.c:2968
 #6  0x001e0803 in PyEval_EvalCode (co=0xaa5fd58, globals=0x83cf3e4,
 locals=0x83cf3e4) at Python/ceval.c:522
 #7  0x001deccb in exec_statement (f=0x81630ec, throwflag=0) at
 Python/ceval.c:4401
 #8  PyEval_EvalFrameEx (f=0x81630ec, throwflag=0) at Python/ceval.c:1717
 #9  0x001e06e7 in PyEval_EvalCodeEx (co=0x837aa88, globals=0x8370714,
 locals=0x0, args=0x8162c08, argcount=2, kws=0x8162c10, kwcount=0,
 defs=0x0, defcount=0,
     closure=0x0) at Python/ceval.c:2968
 #10 0x001dea92 in fast_function (f=0x8162abc, throwflag=0) at
 Python/ceval.c:3802
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9678#comment:35>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to