Ticket #9678 (closed task: fixed)
Rewrite interrupt handling
|Reported by:||jdemeyer||Owned by:||jdemeyer|
|Component:||c_lib||Keywords:||interrupt, error, c, cython|
|Report Upstream:||N/A||Reviewers:||Volker Braun|
|Authors:||Jeroen Demeyer||Merged in:||sage-4.7.alpha1|
Description (last modified by jdemeyer) (diff)
There are lots of things to be improved in the interrupt handling routines in c_lib/src/interrupt.c and c_lib/include/interrupt.h.
Major changes planned:
- DONE: make sig_on() have function syntax so that we can declare it cdef int sig_on() except 0. See #10115 for the syntax changes.
- DONE: do not save signals in sigsetjmp() (by giving a second argument of 0 instead of 1). This speeds up a sig_on/sig_off loop from 382 clock cycles to 30 clock cycles on a Core(TM)2 Duo CPU T5870 @ 2.00GHz running Linux 2.6.34 glibc 2.11.2.
- DONE: using sigaction() instead of signal() since that has more well-defined semantics.
- DONE: handle SIGINT differently from other signals (other signals are urgent and cannot be ignored. SIGINT on the other hand does not need to handled immediately, but we have to be careful for race conditions).
- DONE: allow sig_on() and sig_off() to be nested.
- DONE: implement sig_retry() for retrying failed computations (this is useful for PARI, see #10018).
- *TODO*: have an interface for more general errors which are not signals. This can then be used by PARI, NTL and possibly other C libraries.
- DONE: clean up old, unused code.
- DONE: testing interrupt handling: #10030.
- DONE: fix breakage because of this patch: #10061.
- DONE: documentation: #10109.
- DONE: Block interrupts during malloc: #10258.
- DONE: eliminate race condition when a SIGINT arrives before sig_on() or during sig_on().
Other potentially related tickets:
- #800 (make _sig_on and _sig_off faster when stacked)
- #9640 (Change PARI error catching mechanism)
- #9564 (libsingular exponentiation can not be interrupted)
- #7879 (Remove unnecessary signal handling for low prec mpfr operations) --- hopefully sig_on() and sig_off() can be made very fast such that this shouldn't be an issue anymore.
- #7794 (PolynomialRing_integral_domain ignores Ctrl-C and segfaults)
- #5313 (patch singular so that when it runs out of memory the error message says "singular" in it)
- #7702 (Handle interrupts better in the notebook)
- #3423 (Make Pari error messages more informative)
- #10126 (Fix error handing in Matrix_rational_dense._invert_pari())
- #10818 (EclLib? should allow signals to make LISP code interruptable)
- Owner changed from jason to tba
- Component changed from misc to c_lib
comment:17 Changed 3 years ago by jdemeyer
- Status changed from new to needs_work
- Description modified (diff)
comment:23 Changed 3 years ago by jdemeyer
- Owner changed from tba to jdemeyer
- Description modified (diff)
comment:28 Changed 2 years ago by jdemeyer
- Status changed from needs_work to needs_review
- Milestone changed from sage-feature to sage-4.6.2
comment:30 follow-up: ↓ 32 Changed 2 years ago by vbraun
- Status changed from needs_review to positive_review
comment:43 Changed 2 years ago by jdemeyer
- Status changed from positive_review to closed
- Resolution set to fixed
- Merged in set to sage-4.7.alpha1