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/04/24 13:37:19 UTC

[GitHub] jaheba opened a new issue #10673: Segmentation Fault when using large mx.nd.array

jaheba opened a new issue #10673: Segmentation Fault when using large mx.nd.array
URL: https://github.com/apache/incubator-mxnet/issues/10673
 
 
   ## Description
   A segmentation fault can occur on some platforms when using large `mx.nd.array`s. The same code runs fine  using `numpy.array`.
   
   This is the code causing the segfault:
   
   ```py
   import numpy as np
   import mxnet as mx
   from random import random as r
   
   # large array with 31x30x2 elements
   # 30x30x2 does not cause a segfault
   a = mx.nd.array([[[[[r()]] for a in range(31)] for b in range(30)] for c in range(2)])
   
   # all three lines are important to reproduce the error
   a = a.swapaxes(1, 2)
   v1 = a[1:-1]
   v2 = a[[0, -1]]
   
   # creating a second array causes the segfault
   mx.nd.array([])
   ```
   
   And this is what happens when running the program:
   
   ```py
   Segmentation fault: 11
   
   Stack trace returned 10 entries:
   [bt] (0) /usr/local/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x192112) [0x7efdc5a1c112]
   [bt] (1) /usr/local/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x27c826e) [0x7efdc805226e]
   [bt] (2) /lib64/libc.so.6(+0x35270) [0x7efdd50b0270]
   [bt] (3) /usr/local/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x1f1670e) [0x7efdc77a070e]
   [bt] (4) /usr/local/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x1f22e8c) [0x7efdc77ace8c]
   [bt] (5) /usr/local/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x237eabd) [0x7efdc7c08abd]
   [bt] (6) /usr/local/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x23003e3) [0x7efdc7b8a3e3]
   [bt] (7) /usr/local/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x2306b5d) [0x7efdc7b90b5d]
   [bt] (8) /usr/local/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x230b209) [0x7efdc7b95209]
   [bt] (9) /usr/local/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x2307ebb) [0x7efdc7b91ebb]
   terminate called without an active exception
   ```
   
   ## Environment
   
   I have tested the following platforms positively for the segfault:
   * docker python:[2/3] images
   * amazonlinux image
   * ubuntu vm on ec2
   
   Dockerfile can be found [here](https://gist.github.com/jaheba/fa27df122e64696c4047f9b3f2bf746d).
   
   However, the segfault **did not** occur when running the same program on my local macbook.
   

----------------------------------------------------------------
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