python / python/cpython

Python 3.15rc2 on macos x86_64 creates additional thread at startup

未关闭
#157,870 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

extension-modules OS-mac release-blocker type-bug
主要语言
Python
星标
77.2k
派生
36k
PR 合并指标
PR 指标待抓取

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
operating-systems
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。