Opened 10 years ago

Closed 8 years ago

#13761 closed defect (fixed)

Segfault with Matrix_integer_2x2

Reported by: Robert Harron Owned by: jason, was
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: linear algebra Keywords: segfault, matrix_integer_2x2
Cc: Merged in:
Authors: Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

The following code generates a segmentation fault:

sage: MS = sage.matrix.all.MatrixSpace(ZZ,2)
sage: M1 = sage.matrix.matrix_integer_2x2.Matrix_integer_2x2(MS, [1, 0, 0, 1], copy = True, coerce = True)
sage: M2 = Matrix(ZZ, 2, 2, [1, 0, 0, 1])
sage: M1 == M2
False
sage: M2 == M1
Unhandled SIGSEGV: ...

It generates a segfault for all other values of copy and coerce in the second line as well. Note however that the following code works perfectly fine:

sage: MS1 = sage.matrix.matrix_integer_2x2.MatrixSpace_ZZ_2x2()
sage: M1 = MS1([1, 0, 0, 1])
sage: MS2 = sage.matrix.all.MatrixSpace(ZZ, 2)
sage: M2 = MS2([1, 0, 0, 1])
sage: M1 == M2
True
sage: M2 == M1
True

One thing to point out is that the construction used in the segfault is that used by the code in arithgroup_element.py and congroup_pyx.pyx, so it may at least be worth to change those files to the non-disastrous construction.

Change History (7)

comment:1 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.11sage-5.12

comment:2 Changed 9 years ago by For batch modifications

Milestone: sage-6.1sage-6.2

comment:3 Changed 8 years ago by For batch modifications

Milestone: sage-6.2sage-6.3

comment:4 Changed 8 years ago by For batch modifications

Milestone: sage-6.3sage-6.4

comment:5 Changed 8 years ago by Jeroen Demeyer

Milestone: sage-6.4sage-duplicate/invalid/wontfix
Reviewers: Jeroen Demeyer
Status: newneeds_review

Obsolete since Matrix_integer_2x2 no longer exists.

comment:6 Changed 8 years ago by Jeroen Demeyer

Status: needs_reviewpositive_review

comment:7 Changed 8 years ago by Volker Braun

Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.