bpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc by vstinner · Pull Request #10510 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation5 Commits3 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

vstinner

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

@vstinner

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

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

@miss-islington

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

@vstinner @miss-islington

…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

@miss-islington

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

@bedevere-bot

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Nov 13, 2018

@vstinner @miss-islington

…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

@vstinner

) (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

@vstinner

) (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.