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

Change MolienSeries to not hang on certain invalid inputs #5919

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

fingolfin
Copy link
Member

When a virtual character that is not an actual character was fed to MolienSeries, that could lead to an infinite loop. The reason in that case was that a quotient of two polynomials was computed that did not produce a polynomial, but rather a rational function. Calling GcdRepresentation(F, f) on that as a first step then tried to compute a ring containing both arguments, which ultimately caused the infinite loop.

We fix this by passing a parent ring to GcdRepresentation which then raises an error in the above situation. The error message of course is not perfect, but note that other invalid inputs already can lead to different errors in other places in the code. Essentially the user is at fault here for passing in garbage. But we make this patch anyway because getting any error is certainly more helpful than an infinite loop.

I am not making any claims that this catches all potential hangs, but it certainly resolves #5284 for me.

@fingolfin fingolfin added the release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes label Jan 28, 2025
When a virtual character that is not an actual character was fed
to MolienSeries, that could lead to an infinite loop. The reason
in that case was that a quotient of two polynomials was computed
that did not produce a polynomial, but rather a rational function.
Calling `GcdRepresentation(F, f)` on that as a first step then
tried to compute a ring containing both arguments, which
ultimately caused the infinite loop.

We fix this by passing a parent ring to `GcdRepresentation` which
then raises an error in the above situation. The error message
of course is not perfect, but note that other invalid inputs
already can lead to different errors in other places in the
code. Essentially the user is at fault here for passing in garbage.
But we make this patch anyway because getting any error is certainly
more helpful than an infinite loop.
Copy link
Contributor

@ThomasBreuer ThomasBreuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea, indeed this catches some kind of bad input.
The failures arise because of a too long line in the testfile.
As soon as the tests pass, the pull request should be merged.

tst/testinstall/ctblmoli.tst Outdated Show resolved Hide resolved
@fingolfin fingolfin enabled auto-merge (squash) January 28, 2025 15:12
@fingolfin
Copy link
Member Author

@ThomasBreuer please approve if you agree for this to be merged :-)

@fingolfin fingolfin merged commit 50fb70e into gap-system:master Jan 28, 2025
33 checks passed
@fingolfin fingolfin deleted the mh/molien branch January 28, 2025 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MolienSeries hangs on an VirtualCharacter
2 participants