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

Possible random failure in test_vector_fields.test_reorient_vector_field_2d #613

matthew-brett opened this Issue Mar 21, 2015 · 3 comments


None yet
3 participants

matthew-brett commented Mar 21, 2015

The build task dipy-py3.3-easy_install tests the installation of the current pypi release, so, after a release, it always tests the same code:

Build 163 failed with the message below, but without any known changes on the build machine. Just rebuilding again passed (build 164), suggesting that the failure may have a random component.

Failure message:

FAIL: dipy.align.tests.test_vector_fields.test_reorient_vector_field_2d
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/numpy/testing/", line 602, in chk_same_position
    assert_array_equal(x_id, y_id)
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/numpy/testing/", line 739, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/numpy/testing/", line 665, in assert_array_compare
    raise AssertionError(msg)
Arrays are not equal

(mismatch 100.0%)
 x: array([[[ True,  True],
        [ True,  True],
        [ True,  True],...
 y: array([[[False, False],
        [False, False],
        [False, False],...

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/buildslave/osx-10.8/dipy-py3_3-pip/build/venv/lib/python3.3/site-packages/nose/", line 198, in runTest
  File "/Users/buildslave/osx-10.8/dipy-py3_3-pip/build/venv/lib/python3.3/site-packages/dipy/align/tests/", line 1342, in test_reorient_vector_field_2d
    assert_array_almost_equal(d, expected)
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/numpy/testing/", line 842, in assert_array_almost_equal
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/numpy/testing/", line 628, in assert_array_compare
    chk_same_position(x_isnan, y_isnan, hasval='nan')
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/numpy/testing/", line 608, in chk_same_position
    raise AssertionError(msg)
Arrays are not almost equal to 6 decimals

x and y nan location mismatch:
 x: array([[[ nan,  nan],
        [ nan,  nan],
        [ nan,  nan],...
 y: array([[[ 2.      , -2.      ],
        [ 1.673582, -1.912665],
        [ 1.21709 , -1.622787],...


This comment has been minimized.


omarocegueda commented Mar 21, 2015

I see! the problem is a memory access violation caused by this line:
the function expects a 3x3 matrix (affine transform in 2D), although it's fine if the matrix is 2x3 (the last row is unnecessary). The access violation occurs here:
and here:

The direct fix is verifying the matrix size in reorient_vector_field (raising exception if invalid), but I will also check the rest of the functions that call the matrix multiplication to make sure it won't happen again.

Thanks Matthew! =)


This comment has been minimized.


matthew-brett commented Mar 21, 2015

Nice detective work - thank you.


This comment has been minimized.


arokem commented Apr 1, 2015

Closed through: #616

@arokem arokem closed this Apr 1, 2015

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