Healpix segfault
-
- Posts: 3
- Joined: December 07 2007
- Affiliation: Imperial College London
Healpix segfault
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
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
-
- Posts: 13
- Joined: July 26 2006
- Affiliation: Max-Planck-Institute for Astrophysics
Healpix segfault
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
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
-
- Posts: 3
- Joined: December 07 2007
- Affiliation: Imperial College London
Healpix segfault
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
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
-
- Posts: 50
- Joined: March 26 2006
- Affiliation: DESY
- Contact:
Healpix segfault
What are the default memory limits on your system? Depending on your shell, run
Try setting the stacksize to unlimited with
Code: Select all
ulimit -a (bash)
limit (tcsh)
Code: Select all
ulimit -s unlimited (bash)
limit s unlimited (tcsh)
-
- Posts: 13
- Joined: July 26 2006
- Affiliation: Max-Planck-Institute for Astrophysics
Healpix segfault
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 :(