On 11/28/2016 04:28 PM, Landon Clipp wrote:
Also one more possible issue I'd add onto my list there: it is possible
that the file is corrupt. So try ruling that out by making an empty HDF5
file in the same directory as the one you're trying to access and run
the same functions, only opening this new file instead.

I think Mark and Landon are saying the same things here, but in different ways.

The 300-some HDF5 user-facing interfaces should return something helpful. The internal interfaces between, say, H5Fopen and lowest-level posix open(2) system call are not helpful for users. The probably aren't all that helpful for developers at this point in the HDF5 life cycle, either.

==rob


Regards,
Landon


On Nov 28, 2016 4:26 PM, "Landon Clipp" <[email protected]
<mailto:[email protected]>> wrote:

    Mark,

    I get what you mean. I have rarely found the error output of HDF5 to
    be of much use, although sometimes it can be helpful. For instance
    just off the top of my head, I've been getting errors about HDF
    attributes. I've called H5Aclose and I get errors about the argument
    not being an attribute. Turns out the variable I passed was never
    initialized. So in that case it's helpful.

    One thing to realize is that the error is most likely NOT reading in
    the library itself. I recommend that you use a debugger like GDB to
    find exactly what you are passing into the function and to see if
    every value you're passing in makes sense. That's really the only
    way to go about it.

    It all comes down to this: H5Fopen is failing and there are a finite
    number of issues we can address.

    1. Does the file exist, and if so are you providing the correct path
    to it (relative or absolute)? Do you have read/write permission for
    the file?
    2. Have you misspelled the file?
    3. Are you providing either DF_ACC_RDWR or DF_ACC_RDONLY to the
    second argument? Only those two arguments are valid.
    4. What file access property list are you providing? You should be
    able to rule out providing a buggy access property by just passing
    in the default parameter.

    I guarantee that your error lies in one of these issues. I recommend
    you make the second and third arguments the read only and default
    respectively. That will isolate the problem to your first argument
    and whether or not you have appropriate file permissions.

    Regards,
    Landon


    On Nov 28, 2016 3:33 PM, "Miller, Mark C." <[email protected]
    <mailto:[email protected]>> wrote:

        "Hdf-forum on behalf of Rob Latham" wrote:


            I think you are going to have to share your output with the
            list.
            Whenever *I* run hdf5 and get an error I get screenfuls of
            information.

            For example, here's a simple hdf5 program trying to open a
            file for
            which I have removed all read and write permissions:

            HDF5-DIAG: Error detected in HDF5 (1.8.16) thread 0:
               #000: ../../../hdf5-1.8.16/src/H5F.c line 604 in
            H5Fopen(): unable to
            open file
                 major: File accessibilty
                 minor: Unable to open file
               #001: ../../../hdf5-1.8.16/src/H5Fint.c line 992 in
            H5F_open():
            unable to open file: time = Mon Nov 28 14:41:40 2016
            , name = 'try.h5', tent_flags = 1
                 major: File accessibilty
                 minor: Unable to open file
               #002: ../../../hdf5-1.8.16/src/H5FD.c line 993 in
            H5FD_open(): open
            failed
                 major: Virtual File Layer
                 minor: Unable to initialize object
               #003: ../../../hdf5-1.8.16/src/H5FDsec2.c line 339 in
            H5FD_sec2_open(): unable to open file: name = 'try.h5',
            errno = 13,
            error message = 'Permission denied', flags = 1, o_flags = 2
                 major: File accessibilty
                 minor: Unable to open file



        I am not sure how other users feel about this and it may not
        even be the original poster's ( Elvis Stansvik) complaint but a
        big challenge I have with interpreting HDF5 errors *is* the
        "...screenfuls of information".

        It is challenging to paw through it to discover the root cause.

        For example, in the above error stack, we get information about
        why sec2 VFD failed..."errno=13 ("Permission enied") but what
        are 'flags' and 'o_flags' there? Are these params to sec2 open
        call? That has only an 'oflag' argument and not an additional
        'flags' argument. And, their numeric values, '1' and '2' are too
        informatvie either. What about similar info at the HDF5 public
        interface (e.g. H5Fopen)? What was passed for 'flags' there. Oh,
        maybe 'flags' in the #003 trace *is* the 'flags' argument caller
        passed to H5Fopen and 'o_flags' is what HDF5 lib passed to sec2
        open call? I could see having 'flags' emitted in the #000 trace
        if that is indeed the argument passed as 'flags' to H5Fopen. and
        'oflags' not 'o_flags' emitted in the #003 trace. Finally, it
        would be *much* more helpful to see the symbolic constants for
        the flags and not their numerics.

        So, I personally find grocking HDF5 error stack output very
        awkward.

        It may be that it is awkward enough for others that no one
        really is able to find the information they needed in it (e.g.
        the signal to noise ratio is just way too low).

        My two cents.

        Mark

        --
        Mark C. Miller, LLNL

        "In the end, we will remember not the words of
        our enemies but the silence of our friends" - MLK

        _______________________________________________
        Hdf-forum is for HDF software users discussion.
        [email protected] <mailto:[email protected]>
        http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
        
<http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org>
        Twitter: https://twitter.com/hdf5



_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5


_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Reply via email to