llvmlite
llvmlite copied to clipboard
Valgrind reports use of uninitialized value
I initially noticed this in attempting to debug a larger application, but it's quite self-contained.
Repro command:
PYTHONMALLOC=malloc valgrind python -m numba
Output:
==26663== Memcheck, a memory error detector
==26663== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==26663== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==26663== Command: python -m numba
==26663==
==26663== Conditional jump or move depends on uninitialised value(s)
==26663== at 0x58B11F: PyUnicode_Decode (in /usr/bin/python3.8)
==26663== by 0x58B474: PyUnicode_FromEncodedObject (in /usr/bin/python3.8)
==26663== by 0x577A5A: ??? (in /usr/bin/python3.8)
==26663== by 0x5F73E2: _PyObject_MakeTpCall (in /usr/bin/python3.8)
==26663== by 0x570D54: _PyEval_EvalFrameDefault (in /usr/bin/python3.8)
==26663== by 0x59C86A: ??? (in /usr/bin/python3.8)
==26663== by 0x5F745E: _PyObject_MakeTpCall (in /usr/bin/python3.8)
==26663== by 0x570D54: _PyEval_EvalFrameDefault (in /usr/bin/python3.8)
==26663== by 0x569DB9: _PyEval_EvalCodeWithName (in /usr/bin/python3.8)
==26663== by 0x5F6EB2: _PyFunction_Vectorcall (in /usr/bin/python3.8)
==26663== by 0x570B25: _PyEval_EvalFrameDefault (in /usr/bin/python3.8)
==26663== by 0x569DB9: _PyEval_EvalCodeWithName (in /usr/bin/python3.8)
==26663==
==26664== Warning: invalid file descriptor 8180 in syscall close()
==26664== Warning: invalid file descriptor 8181 in syscall close()
==26664== Warning: invalid file descriptor 8182 in syscall close()
==26664== Warning: invalid file descriptor 8183 in syscall close()
==26664== Use --log-fd=<number> to select an alternative log fd.
==26664== Warning: invalid file descriptor 8184 in syscall close()
==26664== Warning: invalid file descriptor 8185 in syscall close()
==26663== Conditional jump or move depends on uninitialised value(s)
==26663== at 0xAA91C0C: llvm::sys::getHostCPUName() (in /home/ubuntu/env/2022-11-07-serial/lib/python3.8/site-packages/llvmlite/binding/libllvmlite.so)
==26663== by 0x7FF4116: LLVMPY_GetHostCPUName (targets.cpp:74)
==26663== by 0x634AFF4: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x634A409: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x7610315: _ctypes_callproc (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x7610AF6: ??? (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x5F627D: PyObject_Call (in /usr/bin/python3.8)
==26663== by 0x56D2D4: _PyEval_EvalFrameDefault (in /usr/bin/python3.8)
==26663== by 0x569DB9: _PyEval_EvalCodeWithName (in /usr/bin/python3.8)
==26663== by 0x5F6EB2: _PyFunction_Vectorcall (in /usr/bin/python3.8)
==26663== by 0x59D81D: ??? (in /usr/bin/python3.8)
==26663== by 0x5F74F5: _PyObject_MakeTpCall (in /usr/bin/python3.8)
==26663==
==26663== Conditional jump or move depends on uninitialised value(s)
==26663== at 0xAA91C50: llvm::sys::getHostCPUName() (in /home/ubuntu/env/2022-11-07-serial/lib/python3.8/site-packages/llvmlite/binding/libllvmlite.so)
==26663== by 0x7FF4116: LLVMPY_GetHostCPUName (targets.cpp:74)
==26663== by 0x634AFF4: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x634A409: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x7610315: _ctypes_callproc (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x7610AF6: ??? (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x5F627D: PyObject_Call (in /usr/bin/python3.8)
==26663== by 0x56D2D4: _PyEval_EvalFrameDefault (in /usr/bin/python3.8)
==26663== by 0x569DB9: _PyEval_EvalCodeWithName (in /usr/bin/python3.8)
==26663== by 0x5F6EB2: _PyFunction_Vectorcall (in /usr/bin/python3.8)
==26663== by 0x59D81D: ??? (in /usr/bin/python3.8)
==26663== by 0x5F74F5: _PyObject_MakeTpCall (in /usr/bin/python3.8)
==26663==
==26663== Conditional jump or move depends on uninitialised value(s)
==26663== at 0xAA91D1D: llvm::sys::getHostCPUName() (in /home/ubuntu/env/2022-11-07-serial/lib/python3.8/site-packages/llvmlite/binding/libllvmlite.so)
==26663== by 0x7FF4116: LLVMPY_GetHostCPUName (targets.cpp:74)
==26663== by 0x634AFF4: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x634A409: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x7610315: _ctypes_callproc (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x7610AF6: ??? (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x5F627D: PyObject_Call (in /usr/bin/python3.8)
==26663== by 0x56D2D4: _PyEval_EvalFrameDefault (in /usr/bin/python3.8)
==26663== by 0x569DB9: _PyEval_EvalCodeWithName (in /usr/bin/python3.8)
==26663== by 0x5F6EB2: _PyFunction_Vectorcall (in /usr/bin/python3.8)
==26663== by 0x59D81D: ??? (in /usr/bin/python3.8)
==26663== by 0x5F74F5: _PyObject_MakeTpCall (in /usr/bin/python3.8)
==26663==
==26663== Conditional jump or move depends on uninitialised value(s)
==26663== at 0xAA91D2A: llvm::sys::getHostCPUName() (in /home/ubuntu/env/2022-11-07-serial/lib/python3.8/site-packages/llvmlite/binding/libllvmlite.so)
==26663== by 0x7FF4116: LLVMPY_GetHostCPUName (targets.cpp:74)
==26663== by 0x634AFF4: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x634A409: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x7610315: _ctypes_callproc (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x7610AF6: ??? (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x5F627D: PyObject_Call (in /usr/bin/python3.8)
==26663== by 0x56D2D4: _PyEval_EvalFrameDefault (in /usr/bin/python3.8)
==26663== by 0x569DB9: _PyEval_EvalCodeWithName (in /usr/bin/python3.8)
==26663== by 0x5F6EB2: _PyFunction_Vectorcall (in /usr/bin/python3.8)
==26663== by 0x59D81D: ??? (in /usr/bin/python3.8)
==26663== by 0x5F74F5: _PyObject_MakeTpCall (in /usr/bin/python3.8)
==26663==
==26663== Conditional jump or move depends on uninitialised value(s)
==26663== at 0xAA91F31: llvm::sys::getHostCPUName() (in /home/ubuntu/env/2022-11-07-serial/lib/python3.8/site-packages/llvmlite/binding/libllvmlite.so)
==26663== by 0x7FF4116: LLVMPY_GetHostCPUName (targets.cpp:74)
==26663== by 0x634AFF4: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x634A409: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x7610315: _ctypes_callproc (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x7610AF6: ??? (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x5F627D: PyObject_Call (in /usr/bin/python3.8)
==26663== by 0x56D2D4: _PyEval_EvalFrameDefault (in /usr/bin/python3.8)
==26663== by 0x569DB9: _PyEval_EvalCodeWithName (in /usr/bin/python3.8)
==26663== by 0x5F6EB2: _PyFunction_Vectorcall (in /usr/bin/python3.8)
==26663== by 0x59D81D: ??? (in /usr/bin/python3.8)
==26663== by 0x5F74F5: _PyObject_MakeTpCall (in /usr/bin/python3.8)
==26663==
==26663== Conditional jump or move depends on uninitialised value(s)
==26663== at 0xAA92010: llvm::sys::getHostCPUName() (in /home/ubuntu/env/2022-11-07-serial/lib/python3.8/site-packages/llvmlite/binding/libllvmlite.so)
==26663== by 0x7FF4116: LLVMPY_GetHostCPUName (targets.cpp:74)
==26663== by 0x634AFF4: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x634A409: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x7610315: _ctypes_callproc (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x7610AF6: ??? (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x5F627D: PyObject_Call (in /usr/bin/python3.8)
==26663== by 0x56D2D4: _PyEval_EvalFrameDefault (in /usr/bin/python3.8)
==26663== by 0x569DB9: _PyEval_EvalCodeWithName (in /usr/bin/python3.8)
==26663== by 0x5F6EB2: _PyFunction_Vectorcall (in /usr/bin/python3.8)
==26663== by 0x59D81D: ??? (in /usr/bin/python3.8)
==26663== by 0x5F74F5: _PyObject_MakeTpCall (in /usr/bin/python3.8)
==26663==
==26663== Use of uninitialised value of size 8
==26663== at 0xAA9201D: llvm::sys::getHostCPUName() (in /home/ubuntu/env/2022-11-07-serial/lib/python3.8/site-packages/llvmlite/binding/libllvmlite.so)
==26663== by 0x7FF4116: LLVMPY_GetHostCPUName (targets.cpp:74)
==26663== by 0x634AFF4: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x634A409: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x7610315: _ctypes_callproc (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x7610AF6: ??? (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x5F627D: PyObject_Call (in /usr/bin/python3.8)
==26663== by 0x56D2D4: _PyEval_EvalFrameDefault (in /usr/bin/python3.8)
==26663== by 0x569DB9: _PyEval_EvalCodeWithName (in /usr/bin/python3.8)
==26663== by 0x5F6EB2: _PyFunction_Vectorcall (in /usr/bin/python3.8)
==26663== by 0x59D81D: ??? (in /usr/bin/python3.8)
==26663== by 0x5F74F5: _PyObject_MakeTpCall (in /usr/bin/python3.8)
==26663==
==26663== Conditional jump or move depends on uninitialised value(s)
==26663== at 0xAA9208F: llvm::sys::getHostCPUName() (in /home/ubuntu/env/2022-11-07-serial/lib/python3.8/site-packages/llvmlite/binding/libllvmlite.so)
==26663== by 0x7FF4116: LLVMPY_GetHostCPUName (targets.cpp:74)
==26663== by 0x634AFF4: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x634A409: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x7610315: _ctypes_callproc (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x7610AF6: ??? (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x5F627D: PyObject_Call (in /usr/bin/python3.8)
==26663== by 0x56D2D4: _PyEval_EvalFrameDefault (in /usr/bin/python3.8)
==26663== by 0x569DB9: _PyEval_EvalCodeWithName (in /usr/bin/python3.8)
==26663== by 0x5F6EB2: _PyFunction_Vectorcall (in /usr/bin/python3.8)
==26663== by 0x59D81D: ??? (in /usr/bin/python3.8)
==26663== by 0x5F74F5: _PyObject_MakeTpCall (in /usr/bin/python3.8)
==26663==
==26663== Use of uninitialised value of size 8
==26663== at 0xAA92098: llvm::sys::getHostCPUName() (in /home/ubuntu/env/2022-11-07-serial/lib/python3.8/site-packages/llvmlite/binding/libllvmlite.so)
==26663== by 0x7FF4116: LLVMPY_GetHostCPUName (targets.cpp:74)
==26663== by 0x634AFF4: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x634A409: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==26663== by 0x7610315: _ctypes_callproc (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x7610AF6: ??? (in /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
==26663== by 0x5F627D: PyObject_Call (in /usr/bin/python3.8)
==26663== by 0x56D2D4: _PyEval_EvalFrameDefault (in /usr/bin/python3.8)
==26663== by 0x569DB9: _PyEval_EvalCodeWithName (in /usr/bin/python3.8)
==26663== by 0x5F6EB2: _PyFunction_Vectorcall (in /usr/bin/python3.8)
==26663== by 0x59D81D: ??? (in /usr/bin/python3.8)
==26663== by 0x5F74F5: _PyObject_MakeTpCall (in /usr/bin/python3.8)
==26663==
numba: error: the following arguments are required: filename
==26663==
==26663== HEAP SUMMARY:
==26663== in use at exit: 4,484,560 bytes in 24,984 blocks
==26663== total heap usage: 862,037 allocs, 837,053 frees, 112,296,391 bytes allocated
==26663==
==26663== LEAK SUMMARY:
==26663== definitely lost: 3,752 bytes in 30 blocks
==26663== indirectly lost: 1,244 bytes in 16 blocks
==26663== possibly lost: 2,148,166 bytes in 8,455 blocks
==26663== still reachable: 2,331,398 bytes in 16,483 blocks
==26663== of which reachable via heuristic:
==26663== stdstring : 2,132 bytes in 38 blocks
==26663== suppressed: 0 bytes in 0 blocks
==26663== Rerun with --leak-check=full to see details of leaked memory
==26663==
==26663== Use --track-origins=yes to see where uninitialised values come from
==26663== For lists of detected and suppressed errors, rerun with: -s
==26663== ERROR SUMMARY: 22 errors from 10 contexts (suppressed: 0 from 0)
The first bits of the report are obviously not related to llvmlite, but the uninitialised value reports do seem to be. I'm not well positioned to tell whether this is a flaw in LLVM, llvmlite, or a false report from valgrind.
I've seen this in valgrind for as long as I've been working on Numba / llvmlite, and I always assumed it was because of the cpuid instruction writing a value in a location that valgrind doesn't know about, but given I don't seem to be able to find any reference to this with Google suggests maybe I'm wrong about this and some further investigation is needed.
Thanks for the question / report!