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

Fix crash when incorrectly accessing a compressed vector v via v{...}[...] or v{...}{...} as if it was a matrix #4442

Merged
merged 1 commit into from
Apr 30, 2021

Conversation

fingolfin
Copy link
Member

For a compressed vector v, writing code involving v{...}[...] and
v{...}{...} would crash GAP.

A subset of this was originally reported by me in 2013 (on the old GAP issue
tracker, hence the issue number 312 you may see inside this PR is not valid
here on GitHub), and later fixed with a workaround. However, back then I did
not realize that there are in total four places that needed the fix, and so
only fixed one of them. I also thought it was just a workaround for a deeper
issue. Upon reanalyzing, I believe this was wrong; the real bug always was
lack of input validation combined with an incorrect use of a feature for
accessing slices of matrices with a vector as input instead of a matrix.

For further details, please read the comment in the test file in this patch.

@fingolfin fingolfin added kind: bug Issues describing general bugs, and PRs fixing them kind: bug: crash Issues describing bugs that cause GAP to crash, and PRs fixing them (used for release notes) topic: kernel release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes labels Apr 29, 2021
tst/testbugfix/2013-03-12-t00285.tst Outdated Show resolved Hide resolved
For a compressed vector `v`, writing code involving `v{...}[...]` and
`v{...}{...}` would crash GAP.

A subset of this was originally reported by me in 2013 (on the old GAP issue
tracker, hence the issue number 312 you may see inside this PR is not valid
here on GitHub), and later fixed with a workaround. However, back then I did
not realize that there are in total four places that needed the fix, and so
only fixed one of them. I also thought it was just a workaround for a deeper
issue. Upon reanalyzing, I believe this was wrong; the real bug always was
lack of input validation combined with an incorrect use of a feature for
accessing slices of matrices with a vector as input instead of a matrix.

For further details, please read the comment in the test file in this patch.
@fingolfin fingolfin merged commit b1d1e66 into gap-system:master Apr 30, 2021
@fingolfin fingolfin deleted the mh/fix-elms-asss-crash branch April 30, 2021 15:17
@fingolfin fingolfin changed the title Fix crash when incorrectly accessing a compressed vector v via v{...}[...] or v{...}{...} as if it was a matrix Fix crash when incorrectly accessing a compressed vector v via v{...}[...] or v{...}{...} as if it was a matrix Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug: crash Issues describing bugs that cause GAP to crash, and PRs fixing them (used for release notes) 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: kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants