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

Recursion depth trap when repeatedly calling Test #1752

Closed
james-d-mitchell opened this issue Sep 29, 2017 · 11 comments
Closed

Recursion depth trap when repeatedly calling Test #1752

james-d-mitchell opened this issue Sep 29, 2017 · 11 comments
Labels
kind: bug Issues describing general bugs, and PRs fixing them
Milestone

Comments

@james-d-mitchell
Copy link
Contributor

james-d-mitchell commented Sep 29, 2017

Observed behaviour

If the contents of the test file bug.tst is:

gap> START_TEST("bug.tst");
gap> IsAbelian("A");
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `IsCommutative' on 1 arguments
gap> STOP_TEST("bug.tst");

and I load GAP without any packages gap -A, then do

    i := 0;; repeat i := i + 1; until not Test("bug.tst");

then when i is 1665

########> Diff in bug.tst:2
# Input is:
IsAbelian("A");
# Expected output:
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `IsCommutative' on 1 arguments
# But found:
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, recursion depth trap (5000)

This is a minimal example of the problem, but this is causing some of the Semigroups package continuous integration test to fail, see the discussion here for more details. This bug is confirm by several others, not only me, so unlikely to be an issue with my setup.

Expected behaviour

The loop to run forever.

Copy and paste GAP banner (to tell us about your setup)

 ┌───────┐   GAP 4.8.7-4353-ga179f09 of today
 │  GAP  │   https://www.gap-system.org
 └───────┘   Architecture: x86_64-apple-darwin16.6.0-clang-default64
 Configuration:  gmp 6.1.1
 Loading the library and packages ...
 Components: trans 1.0, prim 3.0, small* 1.0, id* 1.0
 Packages:   GAPDoc 1.5.1
 Try '??help' for help. See also '?copyright', '?cite' and '?authors'
gap>
@james-d-mitchell james-d-mitchell added the kind: bug Issues describing general bugs, and PRs fixing them label Sep 29, 2017
@ChrisJefferson
Copy link
Contributor

I suspect the problem is we don't reset the depth of the stack when we longjmp.

@james-d-mitchell
Copy link
Contributor Author

james-d-mitchell commented Sep 29, 2017

It seems to be a bit unpredictable, whether it happens or not.

@ChrisJefferson
Copy link
Contributor

It will be (I suspect) connected to the number of tests which exit via an error.

@wilfwilson
Copy link
Member

Yes. In our continuous integration, it was always one of the last files to be tested that was having problems.

@ChrisJefferson
Copy link
Contributor

Ah, just checking, is this only on 4.8? I have a feeling I fixed something related to this in master (and the error doesn't seem to trigger in master for me)

@wilfwilson
Copy link
Member

We only test with master at the moment, so I don't know anything about whether it's present in stable-4.8.

@ChrisJefferson
Copy link
Contributor

Ah, no, I can reproduce it, it just takes a while.

If I add a way of printing out GAP's RecursionDepth, then I can see it increases by 3 each time we run the test, so eventually we overflow.

@ChrisJefferson
Copy link
Contributor

Fix coming up.

@james-d-mitchell
Copy link
Contributor Author

Awesome @ChrisJefferson, thanks

@ChrisJefferson
Copy link
Contributor

This is (hopefully) fixed by #1753.

@markuspf
Copy link
Member

markuspf commented Oct 2, 2017

Fixed by #1753

@markuspf markuspf closed this as completed Oct 2, 2017
@olexandr-konovalov olexandr-konovalov added this to the GAP 4.9.0 milestone Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Issues describing general bugs, and PRs fixing them
Projects
None yet
Development

No branches or pull requests

5 participants