This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Error when calling numpy.astype
Type: crash Stage: resolved
Components: Interpreter Core Versions: Python 3.5
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, crwilcox, droth
Priority: normal Keywords:

Created on 2017-08-29 02:10 by droth, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
memdump.txt droth, 2017-08-29 02:10 Memory Map
Messages (3)
msg300970 - (view) Author: Daniel (droth) Date: 2017-08-29 02:10
Ubuntu 16.04.3
Python 3.5.2
Numpy version 1.11.0

Running the following two commands causes Python to crash:
import numpy as np
np.array([[1, 2],[3,4]]).astype(np.dtype([("a", np.float), ("b", np.str_)]))

The error occurs when running in an interactive session and when running those two commands as a script.

The error I get is:
*** Error in `python3': free(): invalid next size (normal): 0x0000000001a088f0 ***

A memory map printed after the error is attached.

The backtrace is
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f55ac35e7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f55ac36737a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f55ac36b53c]
/usr/lib/python3/dist-packages/numpy/core/multiarray.cpython-35m-x86_64-linux-gnu.so(+0x6d35e)[0x7f55ab0fa35e]
/usr/lib/python3/dist-packages/numpy/core/multiarray.cpython-35m-x86_64-linux-gnu.so(+0x45a29)[0x7f55ab0d2a29]
/usr/lib/python3/dist-packages/numpy/core/multiarray.cpython-35m-x86_64-linux-gnu.so(+0x461a2)[0x7f55ab0d31a2]
/usr/lib/python3/dist-packages/numpy/core/multiarray.cpython-35m-x86_64-linux-gnu.so(+0xcf828)[0x7f55ab15c828]
python3(PyCFunction_Call+0x77)[0x4e9bc7]
python3(PyEval_EvalFrameEx+0x614)[0x524414]
python3[0x52d2e3]
python3(PyEval_EvalCode+0x1f)[0x52dfdf]
python3[0x5fd2c2]
python3(PyRun_FileExFlags+0x9a)[0x5ff76a]
python3(PyRun_SimpleFileExFlags+0x1bc)[0x5ff95c]
python3(Py_Main+0x456)[0x63e7d6]
python3(main+0xe1)[0x4cfe41]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f55ac307830]
python3(_start+0x29)[0x5d5f29]
msg301547 - (view) Author: Chris Wilcox (crwilcox) * Date: 2017-09-07 00:11
I may be wrong, but this seems like it could be an issue with NumPy. There are similar issues on their GitHub around crashes on astype. It probably wouldn't hurt to file this over there as well.
https://github.com/numpy/numpy/issues
msg305359 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-11-01 05:31
Chris is right. Please report this to numpy developers. We can always reopen this issue if they decide that this is an issue in Python. Thank you.

By the way, I cannot reproduce the crash with numpy 1.13.3.
History
Date User Action Args
2022-04-11 14:58:51adminsetgithub: 75479
2017-11-01 05:31:38berker.peksagsetstatus: open -> closed

nosy: + berker.peksag
messages: + msg305359

resolution: third party
stage: resolved
2017-09-07 00:11:15crwilcoxsetnosy: + crwilcox
messages: + msg301547
2017-08-29 02:10:29drothcreate