Segfault launching ipykernel on Python 3.12.3 in VS Code Jupyter (works on Python 3.11)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
调研方向
使用 python3 -X faulthandler -m ipykernel_launcher -f /tmp/test_kernel.json 重现故障,然后将其与正常工作的 Python 3.11 命令进行比较。从 ipykernel_launcher.py、ipykernel/kernelapp.py 和列出的原生扩展开始;完成的标准是 Python 3.12 启动内核并创建其连接文件,且不发生 segmentation fault。
由索引模型根据 Issue 内容生成。
描述
Summary
Summary
A Jupyter kernel startup failure occurs when launching ipykernel under Python 3.12.3 inside the project virtual environment. The process crashes with Segmentation fault during IPKernelApp initialization. The same kernel startup works correctly on Python 3.11.15.
This appears to be a bug in the ipykernel / IPython startup path for Python 3.12 rather than a notebook-specific issue.
Reproduction Steps
-
Open the project directory:
cd /home/alvaritogsg/personalProjects/nuclioShool/nuclio_charlas -
Activate the virtual environment:
. .venv/bin/activate -
Run the kernel launcher directly with faulthandler:
python3 -X faulthandler -m ipykernel_launcher -f /tmp/test_kernel.json -
Observe the crash:
Segmentation fault (core dumped)- No
/tmp/test_kernel.jsonfile is created.
-
Compare with Python 3.11:
python3.11 -X faulthandler -m ipykernel_launcher -f /tmp/test_kernel_py311.json -
The Python 3.11 kernel starts successfully and remains alive.
Actual Behavior
The kernel process crashes immediately with a segmentation fault while initializing the IPython kernel application.
The stack trace includes:
logging/__init__.pyIPython/core/application.pyipykernel/kernelapp.pytraitlets/config/application.pyipykernel_launcher.py
Loaded native extension modules at the time of the crash:
zmq.backend.cython._zmqtornado.speedupspsutil._psutil_linux
VS Code reports:
The error displaed by VS Code was:
Error: El kernel ha muerto. Error: ... Vea Jupyter [log](command:jupyter.viewOutput) para obtener más detalles.
- The execution that is falling is:
~python -m ipykernel_launcher - The check command
python -c "import ipykernel; print(...)"works correctly.
Expected Behavior
The kernel should start normally and create a connection file such as /tmp/test_kernel.json. Jupyter frontends should be able to connect to the kernel without the process dying.
Environment
- OS: Linux (WSL/Remote VS Code)
- VS Code Jupyter extension:
2025.9.1 - Python 3.12.3 virtualenv:
/home/alvaritogsg/personalProjects/nuclioShool/nuclio_charlas/.venv
Package Versions in .venv
ipython 9.12.0ipykernel 7.2.0jupyter-client 8.8.0jupyter-core 5.9.1traitlets 5.14.3tornado 6.5.5pyzmq 27.1.0psutil 7.2.2
Python Version Comparison
- Python 3.12.3: fails
- Python 3.11.15: works
The working Python 3.11 environment was tested using a temporary venv and a similar ipykernel_launcher command.
Additional Notes
python3 -m IPython --helpworks and evenpython3 -m ipykernel_launcher --helpsucceeds, but actual kernel startup still crashes.- The crash appears to happen before any frontend-level Jupyter communication begins, so this is likely not a VS Code issue.
- The failing path is likely in the
ipykernel/IPythoninitialization logic, possibly specific to Python 3.12 in this environment.
- 主要语言
- Python
- 星标
- 734
- 派生
- 411
- 平均合并
- 1 天 5 小时
- 30 天内合并 PR
- 8
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ipython/ipykernel 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
-
难度 4/5 3-5 天 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 66/100
-
难度 4/5 3-5 天 新手友好度 35/100
查看 ipython/ipykernel 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 88/100
use-agent-os/agent-os#3314 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
BasedHardware/omi#15662 · 1 条评论 ·
-
documentation help wanted
难度 2/5 1-3 小时 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 62/100
AiursoftWeb/AnduinOS-2#19 ·