-
-
Notifications
You must be signed in to change notification settings - Fork 656
Fix Ctrl-C segfaults in sage.libs.gap #40613
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
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
e0b0c06
Fix segmentation fault in libgap function call
user202729 4d1f19f
Code modification to avoid calling GapElement.__dealloc__ too early
user202729 c6b76b6
src/sage/libs/gap/gap_includes.pxd: add InterruptExecStat
orlitzky f9c186d
src/sage/libs/gap/util.pyx: add gap_sig_on / gap_sig_off
orlitzky a9473ca
src/sage/libs/gap/util.pyx: replace sig_on / sig_off
orlitzky fc16eae
src/sage/libs/gap/element.pyx: replace sig_on / sig_off
orlitzky a887924
src/sage/libs/gap/meson.build: remove cysignals dependency
orlitzky a219ac9
src/sage/libs/gap/libgap.pyx: update signal handling docs
orlitzky 0b66eba
src/sage/doctest/util.py: handle Ctrl-C from GAP
orlitzky e1e8d62
src/sage/libs/gap/gap_includes.pxd: drop sig_GAP_Enter()
orlitzky 2ca060f
src/sage/libs/gap/libgap.pyx: rewrite signal handling explanation
orlitzky 7c48f94
src/sage/libs/gap/util.pyx: do KeyboardInterrupt conversion earlier
orlitzky fb458ad
src/sage/doctest/util.py: update GAP workaround
orlitzky 51c81b0
src/sage/libs/gap: remove redundant KeyboardInterrupt hacks
orlitzky bab97f6
src/sage/libs/gap/util.pyx: type-safety for InterruptExecStat()
orlitzky b298ca8
src/sage/doctest/util.py: further simplify GAP workaround
orlitzky 867cf66
src/sage/libs/gap/libgap.pyx: explain error handling
orlitzky cd93bdf
src/sage/libs/gap/util.pyx: delete old commented debug statement
orlitzky 794b427
src/sage/libs/gap: use public API for is_string()
orlitzky ee6af07
src/sage/libs/gap/element.pyx: missing GAP_Enter / GAP_Leave
orlitzky e7bb222
src/sage/libs/gap/element.pyx: drop superclass list -> sage conversion
orlitzky d9bd3c2
src/sage/libs/gap: be more careful inside make_any_gap_element()
orlitzky e79bdd7
src/sage/libs/gap/element.pyx: revert list-of-char changes
orlitzky 3220d8f
src/sage/libs/gap/libgap.pyx: more realistic "real" example
orlitzky 24065b5
src/sage/libs/gap/libgap.pyx: clarify "GAP library usage"
orlitzky 041fcdf
src/sage/libs/gap/libgap.pyx: fix module docstring indentation
orlitzky 50157d7
src/sage/libs/gap/libgap.pyx: more module docstring tweaks
orlitzky b550b36
src/sage/libs/gap/util.pyx: add missing noexcept annotation
orlitzky 677c2f1
src/sage/libs/gap/element.pyx: more tolerance in Ctrl-C tests
orlitzky 1af02c2
src/sage/libs/gap: special case for bool in make_any_gap_element()
orlitzky f39be09
src/sage/libs/gap/element.pyx: update make_any_gap_element() comment
orlitzky 36da2ca
src/sage/libs/gap/element.pyx: faster list length check
orlitzky 3a6d006
src/sage/libs/gap/libgap.pyx: slightly safer example
orlitzky 8b8c496
src/sage/rings/complex_arb.pyx: add some Ctrl-C tolerance to a doctest
orlitzky 6e74192
src/sage/libs/gap/libgap.pyx: unindent the "Using the .. library" docs
orlitzky 47826c2
src/sage/libs/gap/libgap.pyx: unindent the AUTHORS block
orlitzky c1adeb9
src/sage/libs/gap/libgap.pyx: backticks for ``libgap-api.h``
orlitzky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the logic below (raise AlarmInterrupt instead of KeyboardInterrupt) are correctly implemented, this change wouldn't be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've further simplified this down to a one-line change, using the fact that
AlarmInterrupt
is a subclass ofKeyboardInterrupt
. Instead of catchingAlarmInterrupt
, we can catchKeyboardInterrupt
, and then check,AlarmInterrupt
?I prefer this to hacking
AlarmInterrupt
into the GAP code at this point becausesage.libs.gap
is otherwise free of cysignals. To raise theAlarmInterrupt
fromsage.libs.gap
we'd have to,meson.build
AlarmInterrupt
last_signal
variablelast_signal
whenever a handler is calledlast_signal
when raising aGAPError
and convert it to the right thingSince this is all for the benefit of one doctest method, it just seems easier to add the one line in that doctest method?