Ticket #159 (new defect)

Opened 3 years ago

Last modified 3 years ago

Writing attributes before data may cause data write to fail

Reported by: Mlesha Owned by: Mark Koennecke
Priority: minor Milestone: NeXus 4.2 Release
Component: napi Version: 4.2rc2
Keywords: Cc:

Description

Calling NXputattr before NXputdata can cause the NXputdata to fail with message ‘No dataset open’ and all 0’s are written to the data file instead of the data. Failure depends on the specific combination of attributes written, and was observed while writing uncompressed XML files but could affect other types. The problem does not occur if all NXputdata are done before NXputattr calls. There is no indication in the API documentation that this order needs to be followed (apart from the example) – either this is an API bug or the documentation needs to include a note that this order needs to be enforced (it is counter-intuitive since in XML output the attributes precede the data).

Change History

comment:1 Changed 3 years ago by Freddie Akeroyd

  • Owner changed from Unassigned to Mark Koennecke
  • Version changed from trunk to 4.2rc2
  • Milestone set to NeXus 4.2 Release

comment:2 Changed 3 years ago by Mark Koennecke

I need to look at the offending code which causes the trouble here. I checked that NXputattr does not move the stack pointer. So writing attributes before data should work for XML.

Note: See TracTickets for help on using tickets.