8000 Passing MagicMock to np.dtype causes a segmentation fault · Issue #12982 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Passing MagicMock to np.dtype causes a segmentation fault #12982

@roachlord

Description

@roachlord

Passing MagicMock to np.dtype causes a segmentation fault. Original issue raised in Pandas

Reproducing code example:

from unittest.mock import MagicMock
import numpy as np

np.dtype(MagicMock())

Error message:

$ gdb --args python runtests.py -g --python mytest.py
Starting program: /home/vagrant/numpy/venv3/bin/python runtests.py -g --python mytest.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Building, see build.log...
Build OK
Enabling display of all warnings

Program received signal SIGSEGV, Segmentation fault.
0x000000000059f332 in ?? ()

Numpy/Python version information:

1.16.1 3.5.2 (default, Nov 12 2018, 13:43:14) 
[GCC 5.4.0 20160609]