GalSim-developers / GalSim-developers/GalSim

FFT segfault

Open
#1,362 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
272
Forks
121
PR merge metrics
No merged PRs in 30d

Description

import galsim

fwhm = 0.00012892424082577847
e1 = 0.0
e2 = 0.0
dx = -0.24762100026331102
dy = 0.3718091783120656
nx = ny = 90
scale = 0.2

print(f"Attempting drawImage with {fwhm=}, {e1=}, {e2=}, {dx=}, {dy=}, {nx=}, {scale=}")
obj = galsim.Kolmogorov(fwhm=fwhm).shear(e1=e1, e2=e2).shift(dx, dy)
img = obj.drawImage(nx=nx, ny=ny, scale=scale)
print(f"ok, sum={img.array.sum():.6f}")

This segfaults with galsim 2.8.4 for me at USDF. Certainly my fault for letting an optimizer try to draw such a thing, but shouldn't the failure be more graceful than a segfault?

Tail of the traceback is

  File "/sdf/group/rubin/sw/conda/envs/lsst-scipipe-13.0.0/lib/python3.13/site-packages/galsim/image.py", line 795 in _wrap
  File "/sdf/group/rubin/sw/conda/envs/lsst-scipipe-13.0.0/lib/python3.13/site-packages/galsim/gsobject.py", line 1997 in drawFFT_finish
  File "/sdf/group/rubin/sw/conda/envs/lsst-scipipe-13.0.0/lib/python3.13/site-packages/galsim/gsobject.py", line 2045 in drawFFT
  File "/sdf/group/rubin/sw/conda/envs/lsst-scipipe-13.0.0/lib/python3.13/site-packages/galsim/gsobject.py", line 1813 in drawImage

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by reproducing the supplied Python snippet with GalSim 2.8.4, then trace the failure through galsim/gsobject.py's drawImage, drawFFT, and drawFFT_finish calls and galsim/image.py's _wrap. Done means this extreme FFT case no longer segfaults and instead fails gracefully or completes with a defined result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.