Hi all,
From my experience, you cannot call H5Eget_msg while traversing the error
stack as (I think) this causes the stack to be reset. This invalidates the
current traversal and produces rubbish data after that point. I have seen
exactly the same behaviour in C with including/excluding the H5Eget_msg
call - my work-around is to record the major/minor numbers for look-up
after the stack traversal is complete. This is somewhat undesirable and it
seems unintuitive that H5Eget_msg should fail in such a way.

Cheers,
Martijn

On 24 March 2014 17:38, Андрей Парамонов <[email protected]> wrote:

> Hello!
>
> According to http://www.hdfgroup.org/HDF5/doc/H5.user/Errors.html,
> H5Ewalk_cb example, one should use H5Eget_major/H5Eget_minor procedures to
> retrieve error information during custom stack traversal. However
> http://www.hdfgroup.org/HDF5/doc/RM/RM_H5E.html#Error-GetMajor says "This
> function has been deprecated"; I believe one needs to use H5Eget_msg
> instead.
>
> I've tried to implement custom error stack traversal. In attachment is a
> minimal example test.dpr which can be compiled with FreePascal. Whaen I run
> the program I get corrupted values in err_desc^.desc:
>
> Major: File accessibilty
> Minor: Unable to open file
> ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■
> ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■
> ☺▌v-#▲☻↑    minor: Unable to open file
> ne 343 in H5FD_sec2_open(): unable to open file: name =
> 'non-existent.hdf', errn
> o = 2, error message = 'No such file or directory', flags = 0, o_flags = 0
> Ён║лллллллл line 1585 in ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■
> ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю
> ■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■☺▌v-#▲☻↑ minor:
> Unab
> le to open file
> ne 343 in H5FD_sec2_open(): unable to open file: name =
> 'non-existent.hdf', errn
> o = 2, error message = 'No such file or directory', flags = 0, o_flags = 0
> Ён║лллллллл: ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■ю■☺▌v-#▲☻↑    minor:
> Unable t
> o open file
> ne 343 in H5FD_sec2_open(): unable to open file: name =
> 'non-existent.hdf', errn
> o = 2, error message = 'No such file or directory', flags = 0, o_flags = 0
> Ён║лллллллл
>
> However if I comment out the following lines, err_desc^.desc stays valid:
>
> //H5Eget_msg(err_desc^.maj_num, @Typ, @Buf, Length(Buf));
> //WriteLn(Format('Major: %s', [String(Buf)]));
> //H5Eget_msg(err_desc^.min_num, @Typ, @Buf, Length(Buf));
> //WriteLn(Format('Minor: %s', [String(Buf)]));
>
> yields
>
> ..\..\src\H5F.c line 1585 in H5Fopen: unable to open file
>
> It seems that H5Eget_msg is the culprit.
>
> Please CC [email protected] if answering this message.
>
> I'm ready to provide any additional info,
> Andrey Paramonov
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]
>
> http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
>
>
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Reply via email to