[Nexus] Bug in NX5getattrinfo ?

andy gotz andy.gotz at esrf.fr
Tue Feb 22 15:09:03 GMT 2005


Hi,

I am trying (some will say at last) to generate some synchrotron data in
Nexus format. But I have encountered problems at the installation :

I am running on under Linux SuSE 8.2 distribution on an Intel CPU. Gcc
is version gcc version 3.3 20030226 (prerelease) (SuSE Linux).

I have downloaded and installed HDF5 (recompiled from sources) version
5-1.6.3 with zlib.

I have downloaded and installed the Nexus api. Version 2.0 (I think
because there is no identification in the source code)

When I run napi5_test it gets stuck in an loop. The offending code is :

       while (iRet != 0) {
          iRet = H5Aiterate(pFile->iVID,&idx,attr_info,&iname);

in NX5getattrinfo() function in napi5.c. According to the HDF5
documentation this call can return a negative value in the case of
problems. Because the while loop is not testing for this it never
returns. I don't know why the return value is negative however. I
changed the code while to the following :

       while (iRet >= 0) {
          iRet = H5Aiterate(pFile->iVID,&idx,attr_info,&iname);

There are 2 such loops in this function. Doing this and making some
changes in napi5_test.c to break instead of return I manage to run the
test program. My output is :

crunch:/data/opid11/inhouse/Fable/nexus/nexus % ./napi5_test
Number of global attributes: 4
   NeXus_version = 2.0.0.
   file_name = NXtest.nx5
   HDF5_Version = 1.6.3
   file_time = 2005-02-22 16:11:56+0100
ERROR: Iteration was not successful
Group: entry(NXentry) contains 8 items
   ch_data(4) = NeXus data
   Subgroup: data(NXdata)
   i1_data(20) = 1 2 3 4
   i2_data(22) = 1000 2000 3000 4000
   i4_data(24) = 1000000 2000000 3000000 4000000
   r4_data(5)
      1.000000 2.000000 3.000000 4.000000
      5.000000 6.000000 7.000000 8.000000
      9.000000 10.000000 11.000000 12.000000
      13.000000 14.000000 15.000000 16.000000
      17.000000 18.000000 19.000000 20.000000
   r8_data(6)
      1.000000 2.000000 3.000000 4.000000
      5.000000 6.000000 7.000000 8.000000
      9.000000 10.000000 11.000000 12.000000
      13.000000 14.000000 15.000000 16.000000
      17.000000 18.000000 19.000000 20.000000
      Number of attributes : 3
         ch_attribute : NeXus
         i4_attribute : 42
         r4_attribute : 3.141593
ERROR: Iteration was not successful

What is the problem? Can anyone help me find my bug? Can I use the nexus
library as it is?

Thanks

Andy






More information about the NeXus mailing list