python / python/cpython

Incremental GC does not collect garbage as soon as expected

Aperta
#142,002 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

3.14 3.15 interpreter-core performance type-bug
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

Bug report

Bug description:

This was found by @Yhg1s . If you run tests with this command:

./python -m test --randseed=3169227856 --no-randomize --single-process test_pyclbr test_trace test_pdb test_iter test_ordered_dict test_urllib2_localnet test_array test_generated_cases test_typing test_fnmatch test_tools test_descr test___all__ test_xml_dom_xmlbuilder test_nturl2path test_hmac test_pickle test_android test_ipaddress test_modulefinder test_interpreters test_zoneinfo test_runpy test_sqlite3 test_bdb test_zipfile test_crossinterp test_pulldom test_pkgutil test_re test_dbm_sqlite3 test_venv test_pyrepl test_xml_etree_c test_gc

The test_gc unit test fails with:

  File "/home/thomas/python/python/main/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/thomas/python/python/main/Lib/test/test_gc.py", line 1573, in test_bug1055820d
    self.fail("gc didn't happen after 50000 iterations")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: gc didn't happen after 50000 iterations

Reverting GH-140262 seems to fix this. It is possible this is related to GH-141890 as well.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs
  • gh-142001

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da test/test_gc.py, in particolare da test_bug1055820d, e riproduci il malfunzionamento usando il comando indicato nel report. Confronta il comportamento con GH-140262 ripristinato e indaga sulla possibile relazione con GH-141890. Il lavoro è completato quando il test non segnala più che la garbage collection è fallita dopo 50,000 iterazioni.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
backend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.