Author Topic: DSIImageDownloader script results in crash  (Read 3703 times)

Offline vetenskapsman

  • Newcomer
  • Posts: 14
    • Cilice Astophotography
DSIImageDownloader script results in crash
« on: 2010 November 26 15:30:37 »
Attempts to run DSIImage Downloader script (ver 1.02) results in a PI crash.  The script runs, the console window
reports the download completes then PI (ver 1.6) crashes before the image is displayed.  I'm running OSX 10.6.5
on a MacBookPro 5,2 (Core2 Duo), 8Gb memory.

Bug? or am I doing something wrong?

A related question ... is there a PI error log file somewhere? 

-carl

Offline Sean Houghton

  • Newcomer
  • Posts: 36
    • Cerebiggum
Re: DSIImageDownloader script results in crash
« Reply #1 on: 2010 November 27 17:00:12 »
I tried to download M33 and it crashed while trying to open the fits file.  It looks like a problem in the fits file decoder library dealing with compressed fits files.  I downloaded and decompressed the file with Safari and it opened in PixInsight with no problems.

The windows version does not download compressed fits files which may be why this hasn't been reported.  If you make a small change in the script to download uncompressed files it works on OSX - but it takes a lot longer to download.  Here's how my modified script looks now:


//#ifeq __PI_PLATFORM__ MSWINDOWS
// On Windows, CFITSIO does not provide gzip compression.
                  + "download-fits";
//#else
//                  + "download-gz-fits";
//#endif


I think the PixInsight guys will have to look in to the fits library crash.  Here's the callstack for the crash.


Application Specific Information:
Assertion failed: (!(Fitsio_Pthread_Status = pthread_mutex_lock(&Fitsio_Lock))), function uncompress_main, file ../../compress.c, line 540.

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libSystem.B.dylib                0x926b2176 __kill + 10
1   libSystem.B.dylib                0x926b2168 kill$UNIX2003 + 32
2   libSystem.B.dylib                0x9274489d raise + 26
3   libSystem.B.dylib                0x9275a9bc abort + 93
4   libSystem.B.dylib                0x927474fc __pthread_markcancel + 0
5   libcfitsio-pxi.dylib             0x1e632d31 uncompress_main + 641
6   libcfitsio-pxi.dylib             0x1e632ed2 uncompress2mem + 114
7   libcfitsio-pxi.dylib             0x1e638e3e mem_uncompress2mem + 94
8   libcfitsio-pxi.dylib             0x1e63a363 mem_compress_open + 595
9   libcfitsio-pxi.dylib             0x1e62bd2f ffopen + 5615
10  libcfitsio-pxi.dylib             0x1e62ee63 ffdkopn + 67
11  FITS-pxm.dylib                   0x1e34c341 pcl::FITSReader::Open(pcl::String const&) + 417
12  FITS-pxm.dylib                   0x1e370a16 pcl::FITSInstance::Open(pcl::String const&) + 246
13  FITS-pxm.dylib                   0x1e4801d1 pcl::FileFormatDispatcher::Open(void*, unsigned short const*) + 401
14  ...iades-astrophoto.PixInsight   0x009121a2 pi::MetaFileFormat::Open(void*, pcl::String const&) const + 1762
15  ...iades-astrophoto.PixInsight   0x002adb84 pi::ImageWindow::Read(pcl::String const&, bool, bool, bool, pcl::IsoString const&) + 7380
16  ...iades-astrophoto.PixInsight   0x00692468 pi::ImageWindow_open(JSContext*, JSObject*, unsigned int, long*, long*) + 648
17  libjs-pxi.dylib                  0x02530b04 js_Invoke + 1380
18  libjs-pxi.dylib                  0x0252352a js_Interpret + 3130
19  libjs-pxi.dylib                  0x02531728 js_Execute + 600
20  libjs-pxi.dylib                  0x024f2b4c JS_ExecuteScript + 60
Sean
Carlsbad, CA
cerebiggum.com

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: DSIImageDownloader script results in crash
« Reply #2 on: 2010 November 30 07:06:55 »
Hi Carl and Sean,

This is a confirmed problem on PixInsight for Mac OS X. Thanks for catching it.

Sean's fix is correct, and in fact I'll include it in the next official release of this script.

The problem is that the CFITSIO library does not recognize Mac OS X as a sufficiently open-source thing as to provide automatic uncompression of GZIP-compressed FITS files. This is the origin of the crash: GZIP compression is not supported by CFITSIO on Mac OS X, as happens on Windows.

I erroneously assumed that since Darwin is an open-source operating system, CFITSIO would provide the same things it provides under GNU/Linux, or at least that seemed pretty logical to me. I forgot to test this script on Mac OS X.

Sorry for the inconvenience.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/