-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
New valgrind warning in Python 3.12.5 #123229
Comments
Probably a false positive, we just need to update the suppressions file. |
Hummm, it may be freaking out that the array of f-string buffers it's not 0-initialized. If you have a small reproducer I can try to test this theory. Alternatively, you can try to compile Python yourself and test with this patch against 3.12: diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 3118fb19846..9e0dee8cc38 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -65,7 +65,7 @@ static const char *type_comment_prefix = "# type: ";
static struct tok_state *tok_new(void) {
struct tok_state *tok =
- (struct tok_state *)PyMem_Malloc(sizeof(struct tok_state));
+ (struct tok_state *)PyMem_Calloc(1, sizeof(struct tok_state));
if (tok == NULL)
return NULL;
tok->buf = tok->cur = tok->inp = NULL; |
Here's a simple reproducer:
For me this generates the valgrind warnings before the expected error @pablogsal, your patch fixes the problem :-) |
…ffers to 0 in the tokenizer
…ffers to 0 in the tokenizer Signed-off-by: Pablo Galindo <[email protected]>
…to 0 in the tokenizer (#123263) Signed-off-by: Pablo Galindo <[email protected]>
…ffers to 0 in the tokenizer (pythonGH-123263) (cherry picked from commit adc5190) Co-authored-by: Pablo Galindo Salgado <[email protected]> Signed-off-by: Pablo Galindo <[email protected]>
…ring buffers to 0 in the tokenizer (pythonGH-123263) (cherry picked from commit adc5190) Co-authored-by: Pablo Galindo Salgado <[email protected]> Signed-off-by: Pablo Galindo <[email protected]>
…uffers to 0 in the tokenizer (GH-123263) (#123264) gh-123229: Fix valgrind warning by initializing the f-string buffers to 0 in the tokenizer (GH-123263) (cherry picked from commit adc5190) Signed-off-by: Pablo Galindo <[email protected]> Co-authored-by: Pablo Galindo Salgado <[email protected]>
…uffers to 0 in the tokenizer (GH-123263) (#123265) (cherry picked from commit adc5190) Signed-off-by: Pablo Galindo <[email protected]>
Fixed! Thanks for the report @julian-smith-artifex-com |
Thanks for reporting and for the fix! This issue affected the behaviour of Black, see #123821 :-) |
Bug report
Bug description:
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 test is the pytest test suite in PyMuPDF - see https://github.com/pymupdf/PyMuPDF/actions/workflows/test-valgrind.yml.
There were no changes to PyMuPDF or MuPDF when the Valgrind warning appeared and Valgrind itself and pytest versions have also not changed. So it looks like the only change is Python itself.
I can look at creating a cut-down reproducer if required.
Thanks,
- Julian
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: