Skip to content

Another Valgrind warning when indexing heterogeneous nested array (Trac #65) #549

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

Closed
numpy-gitbot opened this issue Oct 19, 2012 · 1 comment

Comments

@numpy-gitbot
Copy link

Original ticket http://projects.scipy.org/numpy/ticket/65 on 2006-04-15 by @alberts, assigned to unknown.

According to Valgrind 3.1.1, the following code performs a conditional jump or move that depends on uninitialised values:

from numpy import array
descr = [('x', 'i4', (2,))]
buffer = ([3,2],)
h = array(buffer, dtype=descr)
h['x']

Valgrind says:

==992== Conditional jump or move depends on uninitialised value(s)
==992==    at 0x454EE42: PyArray_NewFromDescr (arrayobject.c:4117)
==992==    by 0x4550909: PyArray_GetField (arraymethods.c:265)
==992==    by 0x456C074: array_subscript (arrayobject.c:2010)
==992==    by 0x456D626: array_subscript_nice (arrayobject.c:2250)
==992==    by 0x2C2A21: PyObject_GetItem (in /usr/lib/libpython2.4.so.1.0)
==992==    by 0x321CBE: PyEval_EvalFrame (in /usr/lib/libpython2.4.so.1.0)
==992==    by 0x324EF7: PyEval_EvalCodeEx (in /usr/lib/libpython2.4.so.1.0)
==992==    by 0x325227: PyEval_EvalCode (in /usr/lib/libpython2.4.so.1.0)
==992==    by 0x341559: (within /usr/lib/libpython2.4.so.1.0)
==992==    by 0x3427D1: PyRun_SimpleFileExFlags (in /usr/lib/libpython2.4.so.1.0)
==992==    by 0x343268: PyRun_AnyFileExFlags (in /usr/lib/libpython2.4.so.1.0)
==992==    by 0x34916C: Py_Main (in /usr/lib/libpython2.4.so.1.0)

Note that this stack trace differs slightly from the one in ticket #485, but both errors might be caused by the same bug.

Tested with !NumPy 0.9.7.2358.

@numpy-gitbot
Copy link
Author

@teoliphant wrote on 2006-04-15

Fixed by setting self->strides and self->dimensions to NULL for 0-dim arrays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant