-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Segmentation fault when 'size' argument to numpy.random.multinomial has type numpy.uint32. #3173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Full trace: *** glibc detected *** python: free(): invalid next size (fast): 0x0000000001b646c0 *** |
Still present in 1.9-devel |
uint32 does not trigger the int path in the shape definition
np.uint32(1)+(2,) is a apparently array([3]) |
All numpy types define these as array operations... That is not clean, I agree, but I am a bit unsure if we can simply change it because after all almost all numpy operation will make scalars from 0-d arrays. One of those annoying how to best check for an integer thing :). One of these days maybe we should expose the C-api until then, a try/except for either tuple(size) or operator.index(size) may be an option? Of course if someone knows a better method... |
Steps to reproduce:
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
It also seems that numpy.random.multinomial behaves incorrectly when the
size
argument is of typenumpy.uint32
- in the above example, each vector is of length 3 whereas the expected behaviour is an array of length 2.Some details about the platform:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.1 LTS
Release: 12.04
Codename: precise
uname -ar
Linux mlui 3.2.0-38-generic #61-Ubuntu SMP Tue Feb 19 12:18:21 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: