python / python/cpython

Crash because of ownership assert in `PyObject_ClearManagedDict`

Đang mở
#152,254 0 bình luận 1 reaction 1 người được giao Xem trên GitHub

@sobolevn đang làm issue này rồi.

Từ ngày 26/6/2026.

interpreter-core type-crash
Ngôn ngữ chính
Python
Star
77.2k
Fork
35.9k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

Crash report

Refs https://github.com/python/cpython/issues/151763
Original description: https://gist.github.com/devdanzin/99b84915b197ae0ade7face262b8af66

Repro:

from unittest.mock import MagicMock
from _testcapi import set_nomemory

set_nomemory(200)              # fail allocations from the 200th onward (lands in shutdown GC)
(MagicMock(), undefined_name)  # build a MagicMock (managed __dict__), then NameError abandons
                               # it into a traceback cycle -> survives to shutdown GC

I have a fix ready.

Linked PRs
  • gh-152255

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.