Skip to content

Valgrind reports uninitialised values in _TAIL_CALL_* opcodes with tail-calling interpreter #160800

Closed as not planned

Description

@ashm-dev

Bug report

Running test_gc under Valgrind on main with --suppressions=Misc/valgrind-python.supp reports multiple Conditional jump or move depends on uninitialised value(s) in _TAIL_CALL_* handlers.

Tracing via --track-origins=yes points to stack allocation in _PyEval_EvalFrameDefault (ceval.c:1269). Existing suppressions in Misc/valgrind-python.supp do not cover these occurrences.

Steps to reproduce

./configure --with-tail-call-interp --with-pydebug --with-valgrind
make -j$(nproc)
valgrind --track-origins=yes --suppressions=Misc/valgrind-python.supp -- ./python -m test test_gc

Actual behavior

==2951043== Conditional jump or move depends on uninitialised value(s)
==2951043==    at 0x4276413: _TAIL_CALL_RETURN_VALUE (generated_cases.c.h:11514)
==2951043==    by 0x4278B6F: _PyEval_EvalFrameDefault (ceval.c:1377)
==2951043==    by 0x4278C0C: _PyEval_EvalFrame (pycore_ceval.h:122)
==2951043==    by 0x4278DFB: _PyEval_Vector (ceval.c:2264)
==2951043==    by 0x426D9EB: builtin___build_class__ (bltinmodule.c:207)
==2951043==    by 0x41A3422: cfunction_vectorcall_FASTCALL_KEYWORDS (methodobject.c:464)
==2951043==    by 0x4143239: _PyObject_VectorcallTstate (pycore_call.h:143)
==2951043==    by 0x414330D: PyObject_Vectorcall (call.c:327)
==2951043==    by 0x4275A1B: _Py_VectorCallInstrumentation_StackRefSteal (ceval.c:791)
==2951043==    by 0x4282772: _TAIL_CALL_CALL (generated_cases.c.h:1906)
==2951043==    by 0x4278B6F: _PyEval_EvalFrameDefault (ceval.c:1377)
==2951043==    by 0x4278C0C: _PyEval_EvalFrame (pycore_ceval.h:122)
==2951043==  Uninitialised value was created by a stack allocation
==2951043==    at 0x4278903: _PyEval_EvalFrameDefault (ceval.c:1269)

==2951043== Conditional jump or move depends on uninitialised value(s)
==2951043==    at 0x42740F7: _TAIL_CALL_YIELD_VALUE (generated_cases.c.h:13620)
==2951043==    by 0x4278B6F: _PyEval_EvalFrameDefault (ceval.c:1377)
...
==2951043==  Uninitialised value was created by a stack allocation
==2951043==    at 0x4278903: _PyEval_EvalFrameDefault (ceval.c:1269)

Similar warnings also occur in:

  • _TAIL_CALL_RETURN_GENERATOR (generated_cases.c.h:11471)

Operating systems tested on

  • Linux (Arch Linux, GCC 16, Valgrind 3.25.1)

### CPython versions tested on:

CPython main branch

### Operating systems tested on:

Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions