[Numpy-discussion] Non-deterministic test failure in master

Nathaniel Smith njs at pobox.com
Wed Jun 27 14:22:10 EDT 2012


According to the Travis-CI build logs, this code produces
non-deterministic behaviour in master:

  a = np.arange(5)
  a[:3] = a[2:]
  assert_equal(a, [2, 3, 4, 3, 4])

Sometimes 'a' is [2, 3, 4, 3, 4], and sometimes it is [4, 3, 4, 3, 4].
The latter is what you get if the assignment is done 'backwards',
like:
  a[2] = a[4]
  a[1] = a[3]
  a[0] = a[2]

For example, in this build the above test failed on Python 3.2 (but
passed on all other versions):
  http://travis-ci.org/#!/numpy/numpy/jobs/1676766
while in this build, it failed on Python 2.5 (but passed on all other versions):
  http://travis-ci.org/#!/numpy/numpy/jobs/1722121

Looks like we have a memcpy somewhere that should be a memmove?

-n



More information about the NumPy-Discussion mailing list