Dave Witte Morris pointed out the following bug (now trac 28970):
M = random_matrix(GF(4), 70, 70)
def test_matrix(iterations=50): for k in range(iterations):
S,U,V = M.smith_form()
print(k)
if not S == U * M * V:
raise ValueError
On OS X, this will often run for a few iterations and then raise a ValueError, or run for a few iterations and then crash Sage. Note that the matrix is fixed at the start, so each iteration should be identical to the others, but this is not happening. Also, the ValueError should never be raised: the definition of Smith normal form is that S == U * M * V. (The code also sometimes raises a NotImplementedError, but this has been addressed at #28967.)
The occasional crash:
python3(37360,0x10f7355c0) malloc: Incorrect checksum for freed object 0x7fce33018c00: probably modified after being freed.
Corrupt value: 0xc000000000000000
python3(37360,0x10f7355c0) malloc: *** set a breakpoint in malloc_error_break to debug
------------------------------------------------------------------------
(no backtrace available)
------------------------------------------------------------------------
Unhandled SIGABRT: An abort() 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.
What's going on? A memory leak or something along those lines? Can someone help to debug this?