Page 1 of 1

Healpix segfault

Posted: May 14 2008
by Jude Bowyer
Hi guys,

This is probably a very basic question, but I can't seem to rid myself of a segmentation fault I get whenever I read a fits file into Healpix using c++.
The code I'm using is basically this:

#include <cxxutils.h>
#include <paramfile.h>
#include <simparams.h>
#include <healpix_map.h>
#include <healpix_map_fitsio.h>
#include <fitshandle.h>

int main (void){

const std::string infile = "map.fits";

Healpix_Map<double> inmap;
read_Healpix_map_from_fits(infile,inmap,1,2); //segfault occurs here

}


Any ideas?

Thanks

Jude

Healpix segfault

Posted: May 15 2008
by Martin Reinecke
Hmm, at first glance the code looks fine.
Are you trying to read a very large map file? It could be that you are exceeding some memory limits on your machine...
Otherwise, if the map file is not too large, could you please post a link where it can be downloaded so that I can try to reproduce this?

Cheers,
Martin

Healpix segfault

Posted: May 15 2008
by Jude Bowyer
Hi Martin,

I've sent you a copy of the code and file - it's only 2.3MB. The map file is the same one which is in the healpix 'test' directory.


Thanks

Jude

Healpix segfault

Posted: May 15 2008
by Pascal Vaudrevange
What are the default memory limits on your system? Depending on your shell, run

Code: Select all

ulimit -a &#40;bash&#41;
limit &#40;tcsh&#41;
Try setting the stacksize to unlimited with

Code: Select all

ulimit -s unlimited &#40;bash&#41;
limit s unlimited &#40;tcsh&#41;

Healpix segfault

Posted: May 15 2008
by Martin Reinecke
Hmm, since the file is only 2.3 MB, and the map is not allocated on the stack, I fear that system limits are not the culprit :(