Skip to content

Reset the options stack after an error also when the break loop is disabled (-T command line option)#6355

Open
ThomasBreuer wants to merge 2 commits intogap-system:masterfrom
ThomasBreuer:TB_OnQuit
Open

Reset the options stack after an error also when the break loop is disabled (-T command line option)#6355
ThomasBreuer wants to merge 2 commits intogap-system:masterfrom
ThomasBreuer:TB_OnQuit

Conversation

@ThomasBreuer
Copy link
Copy Markdown
Contributor

This situation occurs for example when the GAP is started by GAP.jl in a Julia session.
Not resetting the options stack has strange effects.

resolves #6350

@ThomasBreuer ThomasBreuer added kind: bug Issues describing general bugs, and PRs fixing them topic: error handling release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes labels Apr 30, 2026
@ThomasBreuer
Copy link
Copy Markdown
Contributor Author

Many CI tests fail (which is not surprising).

One reason is that now the message #I Options stack has been reset appears in those cases where the stack was not empty before the error happened. Here we can argue that we want this message to be printed also in the case that the break loop is disabled (and if the InfoWarning level is at least 1), and thus the tests should be adjusted.

I expect that this change will affect also package tests, and since a new GAP version is planned for next week, it will be a bad idea to make this change part of that new GAP version, because then several package tests would have to be adjusted.
This is bad because emptying the options stack in the case of errors would be good for all users of GAP via OSCAR.

Another reason for failures is that OnQuit calls ResetMethodReordering, and some of the testfiles use TraceMethods for switching on some output about the method selection, such that executing GAP code in OnQuit is likely to produce more output than without TraceMethods.
We could modify the pull request such that just the proposed OnQuit call gets replaced by just emptying the options stack.
On the other hand: Why is ResetMethodReordering called in OnQuit? (This was added in #2773, and this change was contained already in the predecessor #2521.)

If we say that we want the fix for #6350 in the next GAP version then we can change this pull request such that
ErrorInner does not call OnQuit when the break loop is disabled, it just resets the options stack, and it does not print the info message in this case.
(Of course this is more a hack than a fix.)

- do not call `OnQuit()` in `ErrorInner` if `BreakOnError` is `false`,
  just reset the options stack (and reset `REREADING` if necessary)
- do not print the info message that the stack got reset
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 release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes topic: error handling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

keep OptionsStack on errors if BreakOnError is false?

1 participant