Segfault launching ipykernel on Python 3.12.3 in VS Code Jupyter (works on Python 3.11)

Offen
#1,512 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
jupyter, jupyter-notebook, python
Bereich
backend, devtools

Rechercherichtung

Reproduziere den Fehler mit python3 -X faulthandler -m ipykernel_launcher -f /tmp/test_kernel.json und vergleiche ihn anschließend mit dem funktionierenden Python-3.11-Befehl. Beginne mit ipykernel_launcher.py, ipykernel/kernelapp.py und den aufgeführten nativen Erweiterungen; abgeschlossen ist die Aufgabe, wenn Python 3.12 den Kernel startet und seine Verbindungsdatei ohne einen Segmentation Fault erstellt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

  1. Open the project directory:

    cd /home/alvaritogsg/personalProjects/nuclioShool/nuclio_charlas
    
  2. Activate the virtual environment:

    . .venv/bin/activate
    
  3. Run the kernel launcher directly with faulthandler:

    python3 -X faulthandler -m ipykernel_launcher -f /tmp/test_kernel.json
    
  4. Observe the crash:

    • Segmentation fault (core dumped)
    • No /tmp/test_kernel.json file is created.
  5. Compare with Python 3.11:

    python3.11 -X faulthandler -m ipykernel_launcher -f /tmp/test_kernel_py311.json
    
  6. 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__.py
  • IPython/core/application.py
  • ipykernel/kernelapp.py
  • traitlets/config/application.py
  • ipykernel_launcher.py

Loaded native extension modules at the time of the crash:

  • zmq.backend.cython._zmq
  • tornado.speedups
  • psutil._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.0
  • ipykernel 7.2.0
  • jupyter-client 8.8.0
  • jupyter-core 5.9.1
  • traitlets 5.14.3
  • tornado 6.5.5
  • pyzmq 27.1.0
  • psutil 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 --help works and even python3 -m ipykernel_launcher --help succeeds, 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 / IPython initialization logic, possibly specific to Python 3.12 in this environment.
Vorherrschende Sprache
Python
Sterne
734
Forks
411
Ø Merge
1 T. 5 Std.
Gemergte PRs (30 T.)
8

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus ipython/ipykernel

Alle Issues in ipython/ipykernel

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

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