SegFault segmentation fault when both `distributed>2025.2` and `requests-cache` are imported

Open
#6,472 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start with the minimal reproduction in the issue, importing iris.load, distributed.Client, and requests_cache, then loading the attached 0.nc file. Compare this with distributed versions before and after 2025.2 and follow the dependency trail recorded in ESMValTool PR 4044. Done means the supplied reproduction no longer segfaults, with the responsible interaction identified.

Written by the indexing model from the issue text.

Description

📰 Custom Issue

Hiya folks, if you've not had a dose of bizarro this week, here's V with it for you 😁

@schlunma and I have spent a good part of yesterday trying to wrap our heads around a fully reproducible SegFault that we started noting in a diagnostic that used to work fine, and we isolated the issue with a smol MRE here:

from iris import load
from distributed import Client
import requests_cache

cubes = load("0.nc")

I am attaching that file here. Note that there are a few clues:

  • not all netCDF4 files throw the segfault; we have seen this particular one throw the wobbly, but there could be others (my guess is how metadata is packed)
  • only distributed>2025.2 will make it SegFault
  • it could be that requests-cache is not the problem, and a dependency of it may be, we didn't go any deeper in the dependency tree than that, it was a whole lot of of work to get there in the first place,, so we called it a day at requests-cache, see our trail here https://github.com/ESMValGroup/ESMValTool/pull/4044

This may be one of those exotic bugs that come online in very rare cases, so prob not to waste too much time on it, just popping it here just in case 🍻

0.nc.txt

Dominant language
Python
Stars
724
Forks
317
Avg merge
3d 20h
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SciTools/iris

All issues in SciTools/iris

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.