New valgrind warning in 3.12.5

I’ve just started seeing a Valgrind (1:3.18.1-1ubuntu2) warning in a Linux (ubuntu-22.04) Github test that started happening today when the Python version changed from 3.12.4 to 3.12.5.

(The Valgrind version has not changed.)

Conditional jump or move depends on uninitialised value(s)
   at 0x4A66154: tok_get_fstring_mode (/home/runner/work/_temp/SourceCode/Parser/tokenizer.c:2705)
   by 0x4A63925: tok_get (/home/runner/work/_temp/SourceCode/Parser/tokenizer.c:2857)
   by 0x4A63925: _PyTokenizer_Get (/home/runner/work/_temp/SourceCode/Parser/tokenizer.c:2862)
   by 0x4A5282D: _PyPegen_fill_token (/home/runner/work/_temp/SourceCode/Parser/pegen.c:298)
   by 0x4A62BAF: fstring_replacement_field_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:15914)
   by 0x4A58F7A: fstring_middle_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:15858)
   by 0x4A58F7A: _loop0_114_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:32096)
   by 0x4A58F7A: fstring_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:16193)
   by 0x4A58F7A: _tmp_259_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:40681)
   by 0x4A58F7A: _loop1_115_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:32163)
   by 0x4A58F7A: strings_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:16294)
   by 0x4A580A7: atom_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:14690)
   by 0x4A60048: primary_raw (/home/runner/work/_temp/SourceCode/Parser/parser.c:14328)
   by 0x4A5FCE8: primary_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:14126)
   by 0x4A5F731: await_primary_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:14080)
   by 0x4A5F731: power_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:13956)
   by 0x4A5F731: factor_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:13906)
   by 0x4A5ECDE: term_raw (/home/runner/work/_temp/SourceCode/Parser/parser.c:13747)
   by 0x4A5E9C0: term_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:13509)
   by 0x4A5E80A: sum_raw (/home/runner/work/_temp/SourceCode/Parser/parser.c:13391)
   by 0x4A5E80A: sum_rule (/home/runner/work/_temp/SourceCode/Parser/parser.c:13342)    

It’s happening early on when running pytest. I can look into creating a reproducer, but i thought i’d mention it here first in case people are already aware.

Thanks,

- Julian

This seems like something that should be reported as an issue in the CPython GitHub repo rather than here:

The ideal issue report would involve distilling this down to a simple code example that reproduces the problem along with an explanation of exactly how you use valgrind and run the code to see this output and also bisecting to find the commit that triggered this.

If that is not immediately easy to do though then as long as you can describe some way for someone else to reproduce this then it is worth opening an issue. In the past I have reported an issue like that and then others came up with a simple reproducer faster than I could have and before I had even finished bisecting.

Another possibility since you didn’t mention it is that it could be a change in pytest. That might seem unlikely but pytest does do strange things with the code internally. You can try --assert=plain to disable some (all?) of the strangeness.

Many thanks for this, i’ll create an issue in GitHub - python/cpython: The Python programming language.

[Update: see: New valgrind warning in Python 3.12.5 · Issue #123229 · python/cpython · GitHub]

[BTW the pytest version is unchanged so i don’t think it’s causing the problem.]

- Julian