GalSim-developers / GalSim-developers/GalSim
FFT segfault
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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