You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/07/17 22:35:13 UTC
[GitHub] saswatac commented on issue #11551: NDArray __getitem__ reads
invalid memory with advanced indexing and negative indices
saswatac commented on issue #11551: NDArray __getitem__ reads invalid memory with advanced indexing and negative indices
URL: https://github.com/apache/incubator-mxnet/issues/11551#issuecomment-405750259
To add to this, I have observed it is not only negative index, but it is for any positive out of bound index.
Further assignment to a out of bound index results in non-deterministic behavior. The assignment is either silently ignored or it fails with a SIGSEV or SIGABRT.
silently ignored -
```
arr = mx.ndarray.ones((10,))
arr[np.array([10], dtype=np.int)] = 2
print arr
```
SIGABRT -
```
arr = mx.ndarray.ones((10,))
for i in range(10):
arr[np.array([10], dtype=np.int)] = 2
print arr
```
SIGSEGV -
```
arr = mx.ndarray.ones((10,))
for i in range(10):
arr[np.array([11,12], dtype=np.int)] = [2,2]
print arr
```
For all these cases of assignment as well as retrieval, we should be failing with a index out of bound error , which is the behavior in numpy for these cases.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services