Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#23742 closed defect (fixed)

Check for overflow in matrix_mod2_dense

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-8.1
Component: linear algebra Keywords:
Cc: SimonKing Merged in:
Authors: Jeroen Demeyer Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: d25c280 (Commits, GitHub, GitLab) Commit:
Dependencies: Stopgaps:

Status badges

Description

sage: M = MatrixSpace(GF(2),2^32)
sage: M(1)
------------------------------------------------------------------------
/home/king/Sage/git/sage/local/lib/python2.7/site-packages/cysignals/signals.so(+0x5e75)[0x7fb34704ee75]
/home/king/Sage/git/sage/local/lib/python2.7/site-packages/cysignals/signals.so(+0x5ec5)[0x7fb34704eec5]
/home/king/Sage/git/sage/local/lib/python2.7/site-packages/cysignals/signals.so(+0x8e97)[0x7fb347051e97]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fb35378d390]
/home/king/Sage/git/sage/local/lib/python2.7/site-packages/sage/matrix/matrix_mod2_dense.so(+0xb102)[0x7fb1b8d71102]
/home/king/Sage/git/sage/local/lib/python2.7/site-packages/sage/matrix/matrix0.so(+0x407ee)[0x7fb1bc5a67ee]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x48bd)[0x7fb353aa18ad]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7fb353aa688c]
/home/king/Sage/git/sage/local/lib/python2.7/site-packages/sage/misc/cachefunc.so(+0x16433)[0x7fb34572a433]
/home/king/Sage/git/sage/local/lib/python2.7/site-packages/sage/misc/cachefunc.so(+0x166c7)[0x7fb34572a6c7]
/home/king/Sage/git/sage/local/lib/python2.7/site-packages/sage/misc/cachefunc.so(+0x1698c)[0x7fb34572a98c]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7fb3539ed483]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x56da)[0x7fb353aa26ca]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7fb353aa688c]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x8020)[0x7fb353aa5010]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7fb353aa688c]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(+0x8567c)[0x7fb353a1e67c]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7fb3539ed483]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(+0x657ec)[0x7fb3539fe7ec]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7fb3539ed483]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(+0xc1985)[0x7fb353a5a985]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7fb3539ed483]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x56da)[0x7fb353aa26ca]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7fb353aa688c]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7fb353aa69a9]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x7428)[0x7fb353aa4418]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7fb353aa688c]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x8020)[0x7fb353aa5010]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7fb353aa688c]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x8020)[0x7fb353aa5010]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7fb353aa688c]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x8020)[0x7fb353aa5010]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7fb353aa688c]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x8020)[0x7fb353aa5010]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7fb353aa688c]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x8020)[0x7fb353aa5010]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7fb353aa688c]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x8020)[0x7fb353aa5010]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7fb353aa688c]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7fb353aa69a9]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyRun_FileExFlags+0x8a)[0x7fb353acaa4a]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(PyRun_SimpleFileExFlags+0xd7)[0x7fb353acbdf7]
/home/king/Sage/git/sage/local/lib/libpython2.7.so.1.0(Py_Main+0xc3e)[0x7fb353ae24be]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fb352cc2830]
python(_start+0x29)[0x400719]
------------------------------------------------------------------------
Attaching gdb to process id 6413.

Failed to run gdb.
Failed to run gdb.
Install gdb for enhanced tracebacks.
------------------------------------------------------------------------
Unhandled SIGSEGV: A segmentation fault occurred.
This probably occurred because a *compiled* module has a bug
in it and is not properly wrapped with sig_on(), sig_off().
Python will now terminate.
------------------------------------------------------------------------
Segmentation fault (core dumped)

Change History (15)

comment:1 Changed 4 years ago by jdemeyer

  • Branch set to u/jdemeyer/check_for_overflow_in_matrix_mod2_dense

comment:2 Changed 4 years ago by jdemeyer

  • Commit set to 927506d140d6c0859c7dcab0c37254556172e116
  • Status changed from new to needs_review

New commits:

927506dCheck for overflow in matrix_mod2_dense

comment:3 follow-up: Changed 4 years ago by SimonKing

What is the reason for changing init_m4ri() so that it could be called repeatedly?

comment:4 in reply to: ↑ 3 Changed 4 years ago by jdemeyer

Replying to SimonKing:

What is the reason for changing init_m4ri() so that it could be called repeatedly?

I'm just removing useless code. It can be called repeatedly but it shouldn't.

comment:5 Changed 4 years ago by SimonKing

  • Status changed from needs_review to needs_work
  • Work issues set to Crash in doc test

According to the patchbot,

sage -t --long src/sage/matrix/matrix_mod2_dense.pyx  # Killed due to kill signal

That's probably relevant.

Moreover,

+Decreased doctests in matrix/matrix_mod2_dense.pyx: from 34 / 35 = 97% to 34 / 36 = 94%
+Coverage went from 43359 / 45063 = 96.219% to 43359 / 45064 = 96.216%
+====================

-matrix/matrix_mod2_dense.pyx: 97.1% (34 of 35)
+matrix/matrix_mod2_dense.pyx: 94.4% (34 of 36)

but that seem to be just because you changed a cdef function to a usual function. But the segfault in the test needs to be fixed.

comment:6 Changed 4 years ago by jdemeyer

  • Dependencies set to #23748
  • Status changed from needs_work to needs_review

comment:7 Changed 4 years ago by jdemeyer

Dependency merged, needs review.

comment:8 Changed 4 years ago by jdemeyer

Tests seem to pass now.

comment:9 Changed 4 years ago by tscrim

Do we even need to have init_m4ri? I don't see why we can't just call m4ri_build_all_codes().

comment:10 Changed 4 years ago by git

  • Commit changed from 927506d140d6c0859c7dcab0c37254556172e116 to d25c280166ae6fad09c8e1b0fa1cff8617f5634e

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

d25c280Check for overflow in matrix_mod2_dense

comment:11 Changed 4 years ago by jdemeyer

  • Dependencies #23748 deleted
  • Work issues Crash in doc test deleted

comment:12 Changed 4 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

LGTM.

comment:13 Changed 4 years ago by vbraun

  • Branch changed from u/jdemeyer/check_for_overflow_in_matrix_mod2_dense to d25c280166ae6fad09c8e1b0fa1cff8617f5634e
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:14 follow-up: Changed 4 years ago by jhpalmieri

  • Commit d25c280166ae6fad09c8e1b0fa1cff8617f5634e deleted

See #24190 for a followup (at least I think it is related).

comment:15 in reply to: ↑ 14 Changed 4 years ago by jdemeyer

Replying to jhpalmieri:

See #24190 for a followup (at least I think it is related).

Obviously.

Note: See TracTickets for help on using tickets.