Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

_tracemalloc__get_object_traceback doesn't handle objects with pre-headers correctly #101430

Closed
Labels
3.12only security fixestype-bugAn unexpected behavior, bug, or error
@colesbury

Description

@colesbury

In the main branch, the function_tracemalloc__get_object_traceback doesn't account for objects with preheaders:

type=Py_TYPE(obj);
if (PyType_IS_GC(type)) {
ptr= (void*)((char*)obj-sizeof(PyGC_Head));
}
else {
ptr= (void*)obj;
}
traceback=tracemalloc_get_traceback(DEFAULT_DOMAIN, (uintptr_t)ptr);

This means that when running with tracemalloc some allocation tracebacks are missing:

importwarningsclassMyClass:def__del__(self):warnings.warn("Uh oh",ResourceWarning,source=self)deffunc():m=MyClass()func()
python3 -Wd -X tracemalloc=2 example.py

cc@markshannon

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp