python / python/cpython

Python 3.15rc2 on macos x86_64 creates additional thread at startup

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

Chưa có ai nhận issue này.

extension-modules OS-mac release-blocker type-bug
Ngôn ngữ chính
Python
Star
77.2k
Fork
36k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

Bug report

Bug description:

Python 3.15rc2 (from the official installer on macos x86_64 (rosetta emulation, not confirmed for native x86 hardware) creates a second thread at startup, causing any attempt to use os.fork with deprecation warnings enabled to emit a warning. This does not occur on arm64 builds or on non-macos platforms (tested linux and windows, x86 and arm).

Reproduction steps
  1. Install python 3.15rc2 from https://www.python.org/downloads/release/python-3150rc2. Tested environment: M1 Macbook Pro running macos 26.6.2. Also observed on whatever github's macos-15 runner gives you.
  2. Run arch -arm64 python3.15 -Werror -c 'import os; os.fork()'. See that no output is produced.
  3. Run arch -x86_64 python3.15 -Werror -c 'import os; os.fork()'. It prints
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import os; os.fork()
               ~~~~~~~^^
DeprecationWarning: This process (pid=98584) is multi-threaded, use of fork() may lead to deadlocks in the child.
Expected results

A freshly started interpreter should not be running more than one thread and should be able to fork without warning.

CPython versions tested on:

3.15

Operating systems tested on:

macOS

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.

Hướng nghiên cứu

Run the two reported arch commands with Python 3.15rc2 and compare the macOS arm64 and x86_64 behavior around os.fork(). Trace interpreter startup and thread creation on the x86_64 build; done when a fresh interpreter has no extra thread and the reported fork deprecation warning is absent.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
operating-systems
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

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.