Skip to content

TST: Fix uninitialized value in masked ndenumerate test#21500

Merged
seberg merged 1 commit intonumpy:mainfrom
seberg:test-fixup-ma-ndenumerate
May 12, 2022
Merged

TST: Fix uninitialized value in masked ndenumerate test#21500
seberg merged 1 commit intonumpy:mainfrom
seberg:test-fixup-ma-ndenumerate

Conversation

@seberg
Copy link
Member

@seberg seberg commented May 12, 2022

The test used unintialized values, if NaN happened to be there
the test would fail (and generally, uninitialized values being used
in tests is bad, since it shows up in valgrind).

The test used unintialized values, if NaN happened to be there
the test would fail (and generally, uninitialized values being used
in tests is bad, since it shows up in valgrind).
@mattip
Copy link
Member

mattip commented May 12, 2022

Thanks, nice catch.

@charris
Copy link
Member

charris commented May 12, 2022

Hmm, I wonder if a similar thing might be happening with the occasional matmul test failures we see.

@seberg
Copy link
Member Author

seberg commented May 12, 2022

Maybe, but it would have to be a lot more subtle than this. If we clearly forget to initialize memory, we would have noticed it long ago when checking with valgrind (unless it is uninitialized memory on the stack!).

Another way to get to unitialized memory/randomness might be due to long being 32bits on windows and that somehow leading to only setting half of a 64bit integer? (i.e. as an invalid option to lapack).

@seberg seberg merged commit fd45ab9 into numpy:main May 12, 2022
@seberg seberg deleted the test-fixup-ma-ndenumerate branch May 12, 2022 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants