python / python/cpython

_PyExecutorObject is exposed to the abidiff tool due to indirect use in PyCodeObject

Offen
#149,196 7 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

topic-C-API topic-JIT type-bug
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
35.9k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

Bug report

Bug description:

The problem is that PyCodeObject is thought of as part of the stable ABI in abidiff. _PyExecutorArray and thus _PyExecutorObject is not an opaque struct, so its fields and offsets are exposed as part of the stable ABI seen by the tool. Theoretically, this should be fine and not lead to crashes long as no one accesses the _PyExecutorObject, but still this is pretty annoying to have if we are to backport changes to the JIT that require changing the executor, as this will trigger a warning on abidiff tools.

There are two possible fixes, turn the executor object in the public header to be an opaque struct, or use a void pointer. I think both are fine, I'm inclined to link to the first one for type-safety reasons).

We can only fix this on main, as any prior version would break the ABIdiff/dump tools.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs
  • gh-153614

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit zu untersuchen, wie PyCodeObject _PyExecutorArray und _PyExecutorObject indirekt für abidiff offenlegt. Vergleiche die beiden vorgeschlagenen Ansätze – eine undurchsichtige öffentliche Struktur oder ein void pointer – und prüfe den verlinkten PR gh-153614 auf den aktuellen Stand der Arbeit. Als erledigt gilt die Aufgabe, wenn die Felder und Offsets des Executors in Vergleichen der stable-ABI nicht mehr offengelegt werden, ohne frühere ABI-Dumps zu beeinträchtigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.