python / python/cpython

macOS: Test availability for dup3() and pipe2() to prevent crashes when building against Xcode 27

Offen
#153,711 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

3.13 3.14 3.15 3.16 extension-modules OS-ios OS-mac type-crash
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
35.9k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

Crash report

What happened?

This year's Apple OS releases (macOS/iOS/tvOS/watchOS/visionOS 27) add support for dup3() and pipe2(). When building for macOS using Xcode 27 beta but running on macOS 26, configure detects these functions, but Python crashes when it tries to use them. As a temporary fix, I'm passing ac_cv_func_dup3=no ac_cv_func_pipe2=no to configure. The real fix will be to use availability checks in Modules/posixmodule.c for dup3() and pipe2(), like gh-97897 does

Prototypes added to sys/unistd.h in the *27 SDK:

__API_AVAILABLE(macos(27.0), ios(27.0), tvos(27.0), watchos(27.0), visionos(27.0))
int     dup3(int, int, int);
__API_AVAILABLE(macos(27.0), ios(27.0), tvos(27.0), watchos(27.0), visionos(27.0))
int     pipe2(int [2], int);

@ned-deily @ronaldoussoren

CPython versions tested on:

3.13

Operating systems tested on:

macOS

Output from running 'python -VV' on the command line:

No response

Linked PRs
  • gh-154718
  • gh-155174
  • gh-155202
  • gh-155206
  • gh-155211
  • gh-155222

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

Lies Modules/posixmodule.c und den Verfügbarkeitsprüfungs-Präzedenzfall in gh-97897 und reproduziere anschließend das im Bericht beschriebene Xcode 27/macOS 26-Konfigurations- und Build-Szenario. Erledigt ist die Aufgabe, wenn dup3() und pipe2() beim Bauen gegen das neuere SDK, aber beim Ausführen auf älteren macOS-Versionen, sicher behandelt werden und die relevanten Build- oder Laufzeitprüfungen erfolgreich sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c, macos, python
Bereich
build-system, operating-systems
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

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