ACIL FM
Dark
Refresh
Current DIR:
/opt/alt/python313/lib64/python3.13/test/crashers
/
opt
alt
python313
lib64
python3.13
test
crashers
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
__pycache__
-
chmod
Open
Rename
Delete
bogus_code_obj.py
628 B
chmod
View
DL
Edit
Rename
Delete
gc_inspection.py
1.07 MB
chmod
View
DL
Edit
Rename
Delete
infinite_loop_re.py
653 B
chmod
View
DL
Edit
Rename
Delete
mutation_inside_cyclegc.py
753 B
chmod
View
DL
Edit
Rename
Delete
README
830 B
chmod
View
DL
Edit
Rename
Delete
recursive_call.py
372 B
chmod
View
DL
Edit
Rename
Delete
trace_at_recursion_limit.py
376 B
chmod
View
DL
Edit
Rename
Delete
underlying_dict.py
282 B
chmod
View
DL
Edit
Rename
Delete
Edit file: /opt/alt/python313/lib64/python3.13/test/crashers/gc_inspection.py
""" gc.get_referrers() can be used to see objects before they are fully built. Note that this is only an example. There are many ways to crash Python by using gc.get_referrers(), as well as many extension modules (even when they are using perfectly documented patterns to build objects). Identifying and removing all places that expose to the GC a partially-built object is a long-term project. A patch was proposed on SF specifically for this example but I consider fixing just this single example a bit pointless (#1517042). A fix would include a whole-scale code review, possibly with an API change to decouple object creation and GC registration, and according fixes to the documentation for extension module writers. It's unlikely to happen, though. So this is currently classified as "gc.get_referrers() is dangerous, use only for debugging". """ import gc def g(): marker = object() yield marker # now the marker is in the tuple being constructed [tup] = [x for x in gc.get_referrers(marker) if type(x) is tuple] print(tup) print(tup[1]) tuple(g())
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply