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

Segfault #132

Closed
culler opened this issue Nov 13, 2022 · 2 comments · Fixed by #149
Closed

Segfault #132

culler opened this issue Nov 13, 2022 · 2 comments · Fixed by #149

Comments

@culler
Copy link

culler commented Nov 13, 2022

While investigating #112 I discovered that the following produces a segfault. Presumably setitem is corrupting something.

sage: from cypari2 import Pari
sage: pari = Pari()
sage: M = pari.matrix(10, 10, range(100))
sage: M[5] = 1000
sage: M

A segfault occurs during the printing.

@videlec
Copy link
Collaborator

videlec commented Nov 14, 2022

Thanks for the report. I do not get a SEGFAULT on sage 9.7 but a "BusError" catched by cysignals. There is definitely something broken with M afterwards

sage: M[5]
1000
sage: M[5,0]
50
sage: M[5,1]
51

@culler
Copy link
Author

culler commented Nov 14, 2022

The Gen __setitem__ method needs to raise an exception if passed an integer index for a matrix. That is how I fixed this in cypari.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants