[Debian-astro-maintainers] Bug#812504: swarp: breaks when coadding many overlapping files
Nilesh Patra
npatra974 at gmail.com
Tue Jan 26 10:22:31 GMT 2021
Hi Julian,
On Sun, 24 Jan 2016 14:57:52 +0100 Julian Taylor <jtaylor.debian at googlemail.com> wrote:
> Package: swarp
> Version: 2.38.0+dfsg-2
> Severity: important
>
> when coadding more than the openfile limit (normally 1024) overlapping
> files swarp aborts due to too many open files.
> To reproduce create some files with overlapping wcs coordinates, set
> ulimit -n to a low enough number and just run SWarp <files>
> This was fixed a while ago but apparently in 2.38 the original patch has
> been mangled into not working anymore.
>
> 1. a in my opinion not useful NOPENFILES_MAX variable was added, and
> when you go over the limit it just warns instead of capping the number
> of files swarp uses (src/prefs.c:536). The original patch capped the
> usage and did not require user configuration or having the process abort
> after hours of resampling because the warning was not read.
> The fix is simple, set the cap in src/prefs.c, as the actual meat of the
> original patch is still in place.
> 2. the cfitsio based opening leaks open file descriptors somewhere. The
> code is kind of convoluted so I could not figure out a good fix. This
> half backed attempt works for the visir pipeline but is likely not
> appropriate for upstream:
>
> --- a/swarp/src/fits/fitscat.c
> +++ b/swarp/src/fits/fitscat.c
> @@ -161,6 +161,7 @@ int close_cat(catstruct *cat)
> }
>
> cat->file = NULL;
> + close_cfitsio(cat);
>
> return RETURN_OK;
> }
> diff --git a/swarp/src/fits/fitstab.c b/swarp/src/fits/fitstab.c
> index 5919b2a..95bb2c4 100644
> --- a/swarp/src/fits/fitstab.c
> +++ b/swarp/src/fits/fitstab.c
> @@ -285,6 +285,9 @@ void copy_tab_fromptr(tabstruct *tabin,
> catstruct *catout, int pos)
> /* First, allocate memory and copy data */
> QCALLOC(tabout, tabstruct, 1);
> *tabout = *tabin;
> + /* set fits handle to NULL to avoid double close and hope its not needed
> + * anymore */
> + tabout->infptr = NULL;
> if (tabin->naxis)
> QMEMCPY(tabin->naxisn, tabout->naxisn, int, tabin->naxis);
> if (tabin->headbuf)
Looks like it has been several years since this bug report, and noticed this when I took co-maintainer ship of this package couple of days ago.
Apologies for such a long delay.
Does the problem persist with the latest release? If not, could you please forward this patch upstream?
Thanks a lot for you work!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/debian-astro-maintainers/attachments/20210126/ca463b4c/attachment-0001.sig>
More information about the Debian-astro-maintainers
mailing list