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

Infinite recursion after too many errors #12

Closed
embray opened this issue Feb 16, 2021 · 2 comments
Closed

Infinite recursion after too many errors #12

embray opened this issue Feb 16, 2021 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@embray
Copy link
Owner

embray commented Feb 16, 2021

The following code, adapted from the doctests, results in a segfault:

from gappy import gap
x = [0, 1, 2]
for _ in range(0, 5000):
    try:
        _ = gap.Sum(*x)
    except ValueError:
        pass

The segfault is caught and handled by cysignals, but from thereafter other GAP errors result in a segfault as well.

However, replacing gap.Sum(*x) with gap.eval('Sum(0, 1, 2)'), although still resulting in a GAPError, does not appear to lead to this condition. So I think the bug is probably local to GapFunction.__call__. Though it's weird that it breaks all error handling.

@embray embray added the bug Something isn't working label Feb 16, 2021
@embray embray added this to the v0.1.0 milestone Feb 16, 2021
@embray embray self-assigned this Feb 16, 2021
@embray
Copy link
Owner Author

embray commented Feb 17, 2021

Provided a fix for this in gap at gap-system/gap#4258 but I should see if there's a way I can work around it, maybe with wrappers for GAP_Enter/Leave.

@embray
Copy link
Owner Author

embray commented Feb 17, 2021

Figured out exactly why the infinite recursion is happening, as explained here: gap-system/gap#4258 (comment)

@embray embray closed this as completed in 13d2d02 Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant