This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Invalid read in pegen.c
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, lys.nikolaou, miss-islington, pablogsal, skrah
Priority: normal Keywords: patch

Created on 2020-06-05 22:00 by skrah, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20666 merged pablogsal, 2020-06-05 23:14
PR 20670 merged miss-islington, 2020-06-05 23:52
Messages (3)
msg370791 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2020-06-05 22:00
From test_decimal:

test_xor (test.test_decimal.PyIBMTestCases) ... ==17597== Invalid read of size 1
==17597==    at 0x64A7E2: newline_in_string (pegen.c:940)
==17597==    by 0x64A84E: bad_single_statement (pegen.c:958)
==17597==    by 0x64AD59: _PyPegen_run_parser (pegen.c:1101)
==17597==    by 0x64B044: _PyPegen_run_parser_from_string (pegen.c:1194)
==17597==    by 0x5C6D56: PyPegen_ASTFromStringObject (peg_api.c:27)
==17597==    by 0x52A2A9: Py_CompileStringObject (pythonrun.c:1259)
==17597==    by 0x63CBF6: builtin_compile_impl (bltinmodule.c:819)
==17597==    by 0x63AF08: builtin_compile (bltinmodule.c.h:249)
==17597==    by 0x5F9446: cfunction_vectorcall_FASTCALL_KEYWORDS (methodobject.c:440)
==17597==    by 0x4D2642: _PyObject_VectorcallTstate (abstract.h:114)
==17597==    by 0x4D26A1: PyObject_Vectorcall (abstract.h:123)
==17597==    by 0x4E3F26: call_function (ceval.c:5111)
==17597==  Address 0xadc82bf is 1 bytes before a block of size 22 alloc'd
==17597==    at 0x4C3016F: realloc (vg_replace_malloc.c:826)
==17597==    by 0x46A983: _PyMem_RawRealloc (obmalloc.c:121)
==17597==    by 0x46B49E: PyMem_Realloc (obmalloc.c:623)
==17597==    by 0x5C9565: translate_newlines (tokenizer.c:654)
==17597==    by 0x5C98FE: PyTokenizer_FromUTF8 (tokenizer.c:751)
==17597==    by 0x64AF7F: _PyPegen_run_parser_from_string (pegen.c:1169)
==17597==    by 0x5C6D56: PyPegen_ASTFromStringObject (peg_api.c:27)
==17597==    by 0x52A2A9: Py_CompileStringObject (pythonrun.c:1259)
==17597==    by 0x63CBF6: builtin_compile_impl (bltinmodule.c:819)
==17597==    by 0x63AF08: builtin_compile (bltinmodule.c.h:249)
==17597==    by 0x5F9446: cfunction_vectorcall_FASTCALL_KEYWORDS (methodobject.c:440)
==17597==    by 0x4D2642: _PyObject_VectorcallTstate (abstract.h:114)
==17597== 



*--cur dereferences one below p->tok->buf in the last iteration.
msg370798 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-06-05 23:52
New changeset 2e6593db0086004a1ca7f7049218ff9573d473c2 by Pablo Galindo in branch 'master':
bpo-40880: Fix invalid read in newline_in_string in pegen.c (#20666)
https://github.com/python/cpython/commit/2e6593db0086004a1ca7f7049218ff9573d473c2
msg370801 - (view) Author: miss-islington (miss-islington) Date: 2020-06-06 00:13
New changeset 15fec5627ac343afd0bfa1e847746071982d5172 by Miss Islington (bot) in branch '3.9':
bpo-40880: Fix invalid read in newline_in_string in pegen.c (GH-20666)
https://github.com/python/cpython/commit/15fec5627ac343afd0bfa1e847746071982d5172
History
Date User Action Args
2022-04-11 14:59:32adminsetgithub: 85057
2020-06-06 00:44:47pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-06-06 00:13:20miss-islingtonsetmessages: + msg370801
2020-06-05 23:52:40miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request19887
2020-06-05 23:52:31pablogsalsetmessages: + msg370798
2020-06-05 23:14:36pablogsalsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request19883
2020-06-05 22:38:33lys.nikolaousetnosy: + gvanrossum, pablogsal
2020-06-05 22:00:14skrahcreate