Skip to content
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

Add signal handler to catch SIGFPE on the GMP 6.3+ #513

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

skirpichev
Copy link
Contributor

Since 6.3.0 some memory errors in mpz/realloc.c trigger SIGFPE exception. I think it's an upstream bug: helpful message should be emitted instead.

This patch install SIGFPE handler, that does this.

Closes #497

Since 6.3.0 some memory errors in mpz/realloc.c trigger
SIGFPE exception.  I think it's an upstream bug: helpful
message should be emitted instead.

This patch install SIGFPE handler, that does this.

Closes aleaxit#497
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 85.59%. Comparing base (224745b) to head (dfaae94).
Report is 46 commits behind head on master.

Files with missing lines Patch % Lines
src/gmpy2.c 25.00% 3 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #513      +/-   ##
==========================================
+ Coverage   85.52%   85.59%   +0.06%     
==========================================
  Files          50       50              
  Lines       11656    11660       +4     
  Branches     2202     2202              
==========================================
+ Hits         9969     9980      +11     
+ Misses       1687     1680       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@skirpichev
Copy link
Contributor Author

GMP_ERROR_DIVISION_BY_ZERO and GMP_ERROR_SQRT_OF_NEGATIVE, in principle, shouldn't be triggered by some code in the gmpy2 codebase. Maybe I should check only GMP_ERROR_MPZ_OVERFLOW?

@casevh
Copy link
Collaborator

casevh commented Sep 14, 2024

GMP_ERROR_DIVISION_BY_ZERO and GMP_ERROR_SQRT_OF_NEGATIVE, in principle, shouldn't be triggered by some code in the gmpy2 codebase. Maybe I should check only GMP_ERROR_MPZ_OVERFLOW?

While GMP_ERROR_DIVISION_BY_ZERO and GMP_ERROR_SQRT_OF_NEGATIVE shouldn't occur, I think it's fine to catch all the errors.

@casevh casevh merged commit eefc737 into aleaxit:master Sep 14, 2024
11 checks passed
@skirpichev skirpichev deleted the gmp-error-handler-497 branch September 14, 2024 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Probably incorrect error message.
3 participants