mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc (GH-10510)
If tracemalloc is not tracing Python memory allocations, _PyMem_DumpTraceback() now suggests to enable tracemalloc to get the traceback where the memory block has been allocated.
This commit is contained in:
parent
474eedfb3d
commit
f966e5397e
2 changed files with 10 additions and 0 deletions
|
@ -486,6 +486,8 @@ class PyMemDebugTests(unittest.TestCase):
|
|||
r" The block was made by call #[0-9]+ to debug malloc/realloc.\n"
|
||||
r" Data at p: cb cb cb .*\n"
|
||||
r"\n"
|
||||
r"Enable tracemalloc to get the memory block allocation traceback\n"
|
||||
r"\n"
|
||||
r"Fatal Python error: bad trailing pad byte")
|
||||
regex = regex.format(ptr=self.PTR_REGEX)
|
||||
regex = re.compile(regex, flags=re.DOTALL)
|
||||
|
@ -500,6 +502,8 @@ class PyMemDebugTests(unittest.TestCase):
|
|||
r" The block was made by call #[0-9]+ to debug malloc/realloc.\n"
|
||||
r" Data at p: cb cb cb .*\n"
|
||||
r"\n"
|
||||
r"Enable tracemalloc to get the memory block allocation traceback\n"
|
||||
r"\n"
|
||||
r"Fatal Python error: bad ID: Allocated using API 'm', verified using API 'r'\n")
|
||||
regex = regex.format(ptr=self.PTR_REGEX)
|
||||
self.assertRegex(out, regex)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue