Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NDFileNexus problem #264

Open
MarkRivers opened this issue Apr 10, 2017 · 0 comments
Open

NDFileNexus problem #264

MarkRivers opened this issue Apr 10, 2017 · 0 comments

Comments

@MarkRivers
Copy link
Member

While testing the master branch I found NDFileNexus did not work at all on my 64-bit RHEL 7 system. It would return an error saying it failed to open the file, when the file path was fine. I tracked down the problem. areaDetector/ADSupport was using Nexus 4.3.1. It defines the following structure:

  typedef struct __NexusFile5 {
        struct iStack5 {
          char irefn[1024];
          int iVref;
          hsize_t iCurrentIDX;
        } iStack5[NXMAXSTACK];
        struct iStack5 iAtt5;
        int iFID;
        int iCurrentG;
        int iCurrentD;
        int iCurrentS;
        int iCurrentT;
        int iCurrentA;
        int iNX;
        int iNXID;
        int iStackPtr;
        char *iCurrentLGG;
        char *iCurrentLD;
        char name_ref[1024];
        char name_tmp[1024];
        char iAccess[2];
  } NexusFile5, *pNexusFile5;

Note that iFID and others are defined to be "int", but they should actually be hid_t, which HDF5 defines to be int64_t. When I add some debugging I see that the hid_t that H5Fcreate() is returning is a large 64-bit number which will not fit in an int. I am not sure how this ever worked on 64-bit systems, but perhaps the hid_t values previously fit in a 32-bit integer.

This is fixed in Nexus 4.4.3, which changes the structure definition to the following:

typedef struct __NexusFile5 {
        struct iStack5 {
                char irefn[1024];
                hid_t iVref;
                hsize_t iCurrentIDX;
        } iStack5[NXMAXSTACK];
        struct iStack5 iAtt5;
        hid_t iFID;
        hid_t iCurrentG;
        hid_t iCurrentD;
        hid_t iCurrentS;
        hid_t iCurrentT;
        hid_t iCurrentA;
        int iNX;
        int iNXID;
        int iStackPtr;
        char *iCurrentLGG;
        char *iCurrentLD;
        char name_ref[1024];
        char name_tmp[1024];
        char iAccess[2];
} NexusFile5, *pNexusFile5;

I am updating ADSupport to use Nexus 4.4.3. It seems to be mostly working on 64-bit Linux, except that when I save a file in "stream" mode I get the following errors:

epics> HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140588119226112:
  #000: ../H5A.c line 512 in H5Aopen_by_name(): can't open attribute
    major: Attribute
    minor: Can't open object
  #001: ../H5Aint.c line 448 in H5A_open_by_name(): unable to load attribute info from object header
    major: Attribute
    minor: Unable to initialize object
  #002: ../H5Oattribute.c line 530 in H5O_attr_open_by_name(): can't locate attribute: 'napimount'
    major: Attribute
    minor: Object not found
HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140588119226112:
  #000: ../H5A.c line 512 in H5Aopen_by_name(): can't open attribute
    major: Attribute
    minor: Can't open object
  #001: ../H5Aint.c line 448 in H5A_open_by_name(): unable to load attribute info from object header
    major: Attribute
    minor: Unable to initialize object
  #002: ../H5Oattribute.c line 530 in H5O_attr_open_by_name(): can't locate attribute: 'napimount'
    major: Attribute
    minor: Object not found
HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140588119226112:
  #000: ../H5A.c line 512 in H5Aopen_by_name(): can't open attribute
    major: Attribute
    minor: Can't open object
  #001: ../H5Aint.c line 448 in H5A_open_by_name(): unable to load attribute info from object header
    major: Attribute
    minor: Unable to initialize object
  #002: ../H5Oattribute.c line 530 in H5O_attr_open_by_name(): can't locate attribute: 'napimount'
    major: Attribute
    minor: Object not found

The above errors happened when streaming 100 images, so the error does not occur on each image since there are only 3 error messages. The file appears to be saved OK, but we need to determine the reason for these messages.

When saving in "Single" mode these errors do not occur.

The new Nexus 4.4.3 code needs to be tested with 32-bit Linux and on Windows and vxWorks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant