dstndstn / astrometry.net

Astrometry.net -- automatic recognition of astronomical images
http://astrometry.net
Other
650 stars 184 forks source link

Out-of-bounds issue for fields larger than 1000 stars #271

Open aMarcireau opened 1 year ago

aMarcireau commented 1 year ago

For very large fields (N > 1000), Astrometry.net runs into an out-of-bounds issue. This appears to be caused by the hard-coded capping of numxy in https://github.com/dstndstn/astrometry.net/blob/7fff04d4b9f2e8bd0a2b2b567541a543a7a733dd/solver/solver.c#L793

The limit is only applied to numxy, which means that startobj or endobj can become larger than numxy and trigger segfaults, for instance in https://github.com/dstndstn/astrometry.net/blob/7fff04d4b9f2e8bd0a2b2b567541a543a7a733dd/solver/solver.c#L879

I am happy to draft a PR, but I think that there are a few possible fixes:

(The issue was first reported by @kevinss5, see https://github.com/neuromorphicsystems/astrometry/issues/5).

dstndstn commented 11 months ago

Hi, Thanks for the bug report. Just so I understand: you only encounter this by calling into the solver code via those Python bindings, is that right? Ie, you have not hit this problem using solve-field? (I'm trying to do the right thing and produce a failing test case or at least a demo before fixing the bug!) thanks!

aMarcireau commented 11 months ago

Hi,

That's correct, I only ran into the bug by bypassing solve-field and directly calling C functions.