Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Seg fault on co-addition
08-21-2014, 09:14 (This post was last modified: 08-21-2014 09:55 by nhurleywalker.)
Post: #1
Seg fault on co-addition
Hi,

I'm trying to swarp a large number (~900) images into a big frame (12000 x 2500 using IMAGESIZE=0 to automatically calculate it). I found that as soon as I got to the co-addition step, swarp would crash. Having had some success with smaller swarps, I reduced the number of images down to about 100 and eventually found a set-up where it would crash, but not take so long to resample the images that debugging was really slow. I ran swarp with gdb:

gdb -args swarp -c mosaic.swarp 10*.2d.fits -IMAGEOUT_NAME dec-72_121_MOL.allsize.swarp.fits -WEIGHTOUT_NAME dec-72_121_MOL.allsize.weight.fits -PROJECTION_TYPE MOL

and after resampling everything fine (as usual), it crashed here:

Code:
> Co-adding line:      1 / 15026  
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fe9fbc31700 (LWP 13553)]
coadd_line (arg=0x7fffffffc030) at coadd.c:1129
1129              wval2 = *(inwpixt++);
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.107.el6_4.5.x86_64 libgcc-4.4.7-3.el6.x86_64

I've asked my sysadmin to update the debug info for glibc and libgcc; when they've done that I'll recompile swarp and try again, and see if I can get any better information.

Looking at the code, it's interesting that it doesn't crash on the previous line:

Code:
fval2 = *(inpixt++);

which I assume is adding the resampled images, while wval2 adds the weights. So there's something wrong with the weights? But when I look at the weight images, they look fine -- lots of zeros of course, but no NaNs or other weirdness.

The only similar problem I could find is this post from 2007, and that appears to be a (solved) bug with the clean-up code, rather than the co-addition, even though it appears at the co-addition stage.

Any help or suggestions would be very welcome! I'll try a few other parameters -- changing the projection, changing the image size etc...

One quick addition: I just tried exactly the same run but changed the CENTER_TYPE and IMAGE_SIZE parameters:

CENTER_TYPE = ALL, IMAGE_SIZE = 0 --> Segfault as described above
CENTER_TYPE = ALL, IMAGE_SIZE = MANUAL --> real image but doesn't include any of the area with useful data, so comes out all zeroes
CENTER_TYPE = MANUAL , IMAGE_SIZE = 0 --> similar, with a different grid of zeros at a different place on the co-ordinate system, again all zeroes
CENTER_TYPE = MANUAL , IMAGE_SIZE = MANUAL --> works fine even if I use the same image size that IMAGE_SIZE = 0 automatically calculates for a manually-specified CENTER!

So there might be nothing wrong with that particular line of code (although I don't know why wval2 crashes and not fval2, but I've probably guessed wrong about what it's doing) and instead there's something wrong with the projection that the automatic settings produce.

I'll stick to setting CENTER and IMAGE manually, although it's a bit more hassle. Perhaps there are some small-angle approximations in that calculation? The fields I'm dealing with cover substantial fractions of the sky.
Find all posts by this user
Quote this message in a reply
08-22-2014, 02:37
Post: #2
RE: Seg fault on co-addition
I can also provoke this crash by specifying a very large image size: 30k x 30k pixels, even if I set the center manually. I'll gradually reduce the image size and see if I can find out what is the critical limit.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)