Author Topic: [PJSR] [Critical] Invalid string properties in the FITSKeyword PJSR object  (Read 1703 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6650
    • View Profile
    • http://pixinsight.com/
The FITSKeyword JavaScript object represents a FITS header keyword in the PixInsight JavaScript Runtime (PJSR). Internally, FITSKeyword stores the three keyword components --name, value and comment-- as null terminated, 8-bit char C strings (dynamic char strings, implemented as instances of the IsoString PCL class).

The bug consists in that the FITSKeyword.name, FITSKeyword.value and FITSKeyword.comment properties wrongly interpret the internal character strings as 16-bit Unicode strings. As a result, only the characters stored at even positions within the strings are returned by these properties. For example, the BZERO keyword name is reported as 'BEO'. There is an evident risk of segmentation fault when these properties are accessed from JavaScript code, but this doesn't seem to happen in practice thanks to internal string allocation strategies (small strings are always allocated into larger chunks of memory initialized with zeros).

This bug has been reported by Mike Reid in this thread of the development forum board. It is a regression in version 1.5 that we didn't discover in 1.6.0.

Workaround: None.

This bug has already been fixed in version 1.6.1, due for release during this week.

Sorry for the inconvenience.
« Last Edit: 2010 May 12 04:34:47 by Juan Conejero »
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • View Profile
    • http://www.carpephoton.com
Nice work Mike in finding the bug and reporting in a way that allowed Juan to fix it quickly. Thanks Juan for jumping on the occasional PI bug like this. It's one of the reasons PI is such a great product. a) it has very few bugs and b) bugs get fixed quickly.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6650
    • View Profile
    • http://pixinsight.com/
Thanks Sander ;)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/