-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Segfault on ndarray with negative dimension i.e. mxnet.nx.zeros((-1,)) #9166
Comments
Is there any use case of trying to create an NDArray of negative size ? |
@Vikas89 shape -1 means MXNet will automatically infer the shape. |
@nswamy Please add label [NDArray] Thanks |
@apeforest this is not a bug but a case of improper exception handling. Please update the labels. |
@anirudhacharya This is causing a core dump. I think it's a bug that needs to be fixed. |
with the latest version of mxnet, the above command neither causes core dump or Segmentation fault.
Based on this, I think this issue can be closed. |
@anirudhacharya Thanks for checking this. Could you please help to update the exception with more meaningful message? Ideally, the user should know that negative number should not be used as dimension in this command. |
Description
When trying to create an ndarray with a negative size in some dimension, I get a segmentation fault or bad_alloc error. I would have expected an exception with a useful message instead. (When executing in a python terminal, I get the bad_alloc error; when I'm executing in Jupyter notebook it gives a segfault).
Environment info (Required)
----------Python Info----------
Version : 3.6.3
Compiler : GCC 7.2.0
Build : ('default', 'Oct 3 2017 21:45:48')
Arch : ('64bit', 'ELF')
------------Pip Info-----------
Version : 9.0.1
Directory : /usr/lib/python3/dist-packages/pip
----------MXNet Info-----------
Version : 1.0.0
Directory : /usr/local/lib/python3.6/dist-packages/mxnet
Commit Hash : 0f05c65
----------System Info----------
Platform : Linux-4.13.0-19-generic-x86_64-with-Ubuntu-17.10-artful
system : Linux
node : adams
release : 4.13.0-19-generic
version : #22-Ubuntu SMP Mon Dec 4 11:58:07 UTC 2017
----------Hardware Info----------
machine : x86_64
processor : x86_64
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 78
Model name: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
Stepping: 3
CPU MHz: 2800.000
CPU max MHz: 3400.0000
CPU min MHz: 400.0000
BogoMIPS: 5616.00
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 4096K
NUMA node0 CPU(s): 0-3
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp
----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0007 sec, LOAD: 0.6986 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0022 sec, LOAD: 0.0343 sec.
Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0030 sec, LOAD: 0.0688 sec.
Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0008 sec, LOAD: 0.2045 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0326 sec, LOAD: 0.0717 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0013 sec, LOAD: 0.0765 sec.
Build info (Required if built from source)
Downloaded via "pip3 install mxnet".
Minimum reproducible example
The text was updated successfully, but these errors were encountered: