New issue by tornaria on void-packages repository https://github.com/void-linux/void-packages/issues/35712 Description: Correct behaviour (using python): ``` $ python Python 3.10.2 (main, Jan 15 2022, 03:11:32) [GCC 10.2.1 20201203] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from cypari2.pari_instance import Pari >>> a = Pari()(54853908712446157179434453567343931596301333824416758692208077566613224454501131209) >>> a.factor() # takes ~ 1/2 hour ^CTraceback (most recent call last): File "", line 1, in File "cypari2/gen.pyx", line 4361, in cypari2.gen.Gen.factor KeyboardInterrupt >>> ``` After running `a.factor()` I hit control-C (the statement takes ~ half hour to finish). Since this is running extension code (pari C library) python is not catching signals; that's why cypari uses cysignals which is supposed to catch the signal and raise the `KeyboardInterrupt`. But when running the same code using ipython nothing happens: ``` $ ipython Python 3.10.2 (main, Jan 15 2022, 03:11:32) [GCC 10.2.1 20201203] Type 'copyright', 'credits' or 'license' for more information IPython 7.31.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: from cypari2.pari_instance import Pari In [2]: a = Pari()(54853908712446157179434453567343931596301333824416758692208077566613224454501131209) In [3]: a.factor() # takes 1/2 hour ^C^C^C^C^C ``` This bug affects our sagemath which is using our system packages for ipython, cypari2, cysignals, etc. When using the vendored version of these packages in sagemath, this works ok: ``` $ ./sage -ipython Python 3.10.2 (main, Jan 15 2022, 03:11:32) [GCC 10.2.1 20201203] Type 'copyright', 'credits' or 'license' for more information IPython 7.29.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: from cypari2.pari_instance import Pari In [2]: a = Pari()(54853908712446157179434453567343931596301333824416758692208077566613224454501131209) In [3]: a.factor() ^C--------------------------------------------------------------------------- KeyboardInterrupt Traceback (most recent call last) in ----> 1 a.factor() cypari2/gen.pyx in cypari2.gen.Gen.factor() KeyboardInterrupt: In [4]: ``` It's possible that there's something about our packages that is breaking signal handling. For the record, the package versions are: - ipython: 7.31.0 in void, 7.29.0 in sagemath - cypari2: 2.1.2 in void, 2.1.2 in sagemath - cysignals: 1.11.2 in void, 1.10.3 in sagemath Downgrading system ipython to 7.29.0 (which I happen to have in my cache) doesn't fix the issue. I will try to build cysignals-1.10.3 as a void package (since 1.11.2 is the first version to be shipped in void) and see if that changes anything.