Skip to content
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

bpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc #10510

Merged
merged 3 commits into from Nov 13, 2018
Merged

bpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc #10510

merged 3 commits into from Nov 13, 2018

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Nov 13, 2018

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.

https://bugs.python.org/issue29564

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.
@vstinner
Copy link
Member Author

Example:

$ ./python -c 'import _testcapi; _testcapi.pymem_buffer_overflow()'
Debug memory block at address p=0x7f1d77a7a160: API 'm'
    16 bytes originally requested
    The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected.
    The 8 pad bytes at tail=0x7f1d77a7a170 are not all FORBIDDENBYTE (0xfb):
        at tail+0: 0x78 *** OUCH
        at tail+1: 0xfb
        at tail+2: 0xfb
        at tail+3: 0xfb
        at tail+4: 0xfb
        at tail+5: 0xfb
        at tail+6: 0xfb
        at tail+7: 0xfb
    The block was made by call #28224 to debug malloc/realloc.
    Data at p: cb cb cb cb cb cb cb cb cb cb cb cb cb cb cb cb

Enable tracemalloc to get the memory block allocation traceback

Fatal Python error: bad trailing pad byte

Current thread 0x00007f1d77b625c0 (most recent call first):
  File "<string>", line 1 in <module>
Aborted (core dumped)

The change adds "Enable tracemalloc to get the memory block allocation traceback" line.

See also: https://pythondev.readthedocs.io/debug_tools.html#memory-debugger

@vstinner vstinner merged commit f966e53 into python:master Nov 13, 2018
@vstinner vstinner deleted the memdump_tracemalloc branch November 13, 2018 14:15
@miss-islington
Copy link
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 13, 2018
…nGH-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.
(cherry picked from commit f966e53)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
@bedevere-bot
Copy link

GH-10514 is a backport of this pull request to the 3.7 branch.

@miss-islington
Copy link
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-10515 is a backport of this pull request to the 3.6 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 13, 2018
…nGH-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.
(cherry picked from commit f966e53)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
vstinner added a commit that referenced this pull request Nov 13, 2018
) (GH-10517)

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.
vstinner added a commit that referenced this pull request Nov 13, 2018
) (GH-10518)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants