Open numpy-gitbot opened 12 years ago
trac user lcampagn wrote on 2012-09-24
I can confirm this bug and reproduce the segmentation fault:
>>> import numpy as np
>>> a = np.empty(1, dtype=[('x', object)])
>>> b = np.empty(1, dtype=[('x', float)])
>>> np.concatenate([a,b])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: invalid type promotion
>>> np.concatenate([a,b])
Segmentation fault (core dumped)
I've run into this crash in a few different instances. I can cause this crash in both Linux (1.6.1-6ubuntu1) and on Windows. I have not been able to generate useful stack traces--it would appear this bug causes some stack corruption.
Title changed from Issue with concatenating structured arrays
to Issue with concatenating structured arrays (segmentation fault)
by trac user lcampagn on 2012-09-24
Original ticket http://projects.scipy.org/numpy/ticket/2084 on 2012-03-19 by atmention:astrofrog, assigned to unknown.
The following demonstrates the issue - even though Numpy knows how to concatenate the fields of a structured array, it crashes if one tries to concatenate the structured arrays themselves:
A similar issue occurs with floating-point values of different endian-ness:
In some cases, this can even cause segmentation faults, though I have yet to find a way to reproduce this consistently.