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

Check for overflow in matrix_mod2_dense #23742

Closed
jdemeyer opened this issue Aug 29, 2017 · 21 comments
Closed

Check for overflow in matrix_mod2_dense #23742

jdemeyer opened this issue Aug 29, 2017 · 21 comments

Comments

@jdemeyer
Copy link

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)

CC: @simon-king-jena

Component: linear algebra

Author: Jeroen Demeyer

Branch: d25c280

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/23742

@jdemeyer jdemeyer added this to the sage-8.1 milestone Aug 29, 2017
@jdemeyer
Copy link
Author

@jdemeyer
Copy link
Author

New commits:

927506dCheck for overflow in matrix_mod2_dense

@jdemeyer
Copy link
Author

Commit: 927506d

@simon-king-jena
Copy link
Member

comment:3

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

@jdemeyer
Copy link
Author

comment:4

Replying to @simon-king-jena:

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.

@simon-king-jena
Copy link
Member

comment:5

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.

@simon-king-jena
Copy link
Member

Work Issues: Crash in doc test

@jdemeyer
Copy link
Author

Dependencies: #23748

@jdemeyer
Copy link
Author

comment:7

Dependency merged, needs review.

@jdemeyer
Copy link
Author

jdemeyer commented Oct 4, 2017

comment:8

Tests seem to pass now.

@tscrim
Copy link
Collaborator

tscrim commented Oct 4, 2017

comment:9

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

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 25, 2017

Changed commit from 927506d to d25c280

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 25, 2017

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

d25c280Check for overflow in matrix_mod2_dense

@jdemeyer
Copy link
Author

Changed dependencies from #23748 to none

@jdemeyer
Copy link
Author

Changed work issues from Crash in doc test to none

@tscrim
Copy link
Collaborator

tscrim commented Oct 25, 2017

comment:12

LGTM.

@tscrim
Copy link
Collaborator

tscrim commented Oct 25, 2017

Reviewer: Travis Scrimshaw

@vbraun
Copy link
Member

vbraun commented Oct 29, 2017

Changed branch from u/jdemeyer/check_for_overflow_in_matrix_mod2_dense to d25c280

@vbraun vbraun closed this as completed in af44562 Oct 29, 2017
@jhpalmieri
Copy link
Member

comment:14

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

@jhpalmieri
Copy link
Member

Changed commit from d25c280 to none

@jdemeyer
Copy link
Author

comment:15

Replying to @jhpalmieri:

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

Obviously.

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

No branches or pull requests

5 participants