Skip to content

Official python:3.15-slim image segfaults on CPUs without AVX2 (3.14-slim, 3.15-bookworm and 3.15-full are fine #162358

Open

Description

@ulbi

Crash report

The official python:3.15-slim Docker image (Debian 13/trixie, Python 3.15.2,
built with GCC 14.2.0) segfaults deterministically at interpreter startup
during import on CPUs without AVX2/BMI2/FMA.

Minimal reproducible example — on a host with an Intel Xeon E3-1220L v2
(Ivy Bridge, no avx2/bmi2/fma):

$ docker run --rm python:3.15-slim python -c "import ctypes, ctypes.util"
Fatal Python error: Segmentation fault

Current thread 0x0000794fe8982380 [python] (most recent call first):
  File "/usr/local/lib/python3.15/enum.py", line Segmentation fault (core dumped)

Note that simple startup still works, e.g. python --version and
python -c "print(1+1)" succeed; the crash appears once import machinery /
ctypes is exercised. In other runs the fault handler points into the import
machinery instead:

Current thread 0x000072ace230d380 [python] (most recent call first):
  File "<frozen importlib._bootstrap>", line Segmentation fault (core dumped)

The same container image, freshly pulled and re-unpacked on a second node in
the same cluster, reproduces the crash on every start; an identical digest on
a Haswell-class node (fma bmi1 bmi2 avx2) runs cleanly. Kernel log shows the
same offset in libpython on every occurrence:

segfault at 4 ip 00007741f0161795 sp ... error 6 in libpython3.15.so.1.0[...+299000]

CPU flag comparison between the two hosts:

crashing host : sse4_1 sse4_2 popcnt aes avx            (Ivy Bridge, no avx2/bmi2/fma)
working host  : fma sse4_1 sse4_2 avx bmi1 avx2 bmi2    (Haswell+)

Variants that do NOT crash on the same Ivy Bridge host:

docker run --rm python:3.12-slim        # ok
docker run --rm python:3.13-slim        # ok
docker run --rm python:3.14-slim        # ok
docker run --rm python:3.15             # full trixie build, ok
docker run --rm python:3.15-slim-bookworm # slim build against Debian 12, glibc 2.36, ok

Variants that DO crash:

docker run --rm python:3.15-slim        # slim-trixie, glibc 2.41
docker run --rm python:3.15-slim-trixie # same build, explicit tag

Since the failing/working pairs share the same CPython source and differ mainly
in base OS toolchain (trixie/glibc 2.41 + GCC 14 vs bookworm/glibc 2.36), this
looks like a miscompilation or intrinsics-related assumption in the official
slim-trixie build that breaks pre-AVX2 CPUs — possibly worth checking whether
the slim-trixie variant compiles with different arch flags than the others.
Image corruption was ruled out (fresh pull with identical digest, re-unpack,
same crash). Real-world impact: any user deploying official python:3.15-slim
containers to older (pre-Haswell) hardware gets a hard crash on every
container start.

Workaround for affected users: use python:3.15 (full) or
python:3.15-slim-bookworm instead.

CPython versions tested on:

3.15

Operating systems tested on:

Linux

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

Python 3.15.2 (main, Nov 5 2026, 07:56:09) [GCC 14.2.0]

Activity

  1. added
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15bugs and security fixesOS-linuxtype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions