# HG changeset patch # User Rik # Date 1556060228 25200 # Node ID cc8182b32f6022be8b8d17a79cfdc42975074745 # Parent ffdfeb835aefd287c44ef1559bb01e60b0886747# Parent eb25b491dad7a166f836048c9548081577f7241a maint: merge stable to default. diff -r ffdfeb835aef -r cc8182b32f60 libinterp/corefcn/ls-hdf5.cc --- a/libinterp/corefcn/ls-hdf5.cc Tue Apr 23 14:08:58 2019 -0700 +++ b/libinterp/corefcn/ls-hdf5.cc Tue Apr 23 15:57:08 2019 -0700 @@ -717,10 +717,10 @@ // check for OCTAVE_GLOBAL attribute: d->global = hdf5_check_attr (data_id, "OCTAVE_GLOBAL"); + retval = (d->tc.load_hdf5 (group_id, name) ? 1 : -1); + H5Tclose (type_id); H5Dclose (data_id); - - retval = (d->tc.load_hdf5 (group_id, name) ? 1 : -1); } if (! ident_valid) @@ -733,7 +733,11 @@ done: if (retval < 0) - error ("load: error while reading hdf5 item %s", name); + { + // Must be warning. A call to error aborts and leaves H5Giterate in + // a mangled state that causes segfault on exit (bug #56149). + warning ("load: error while reading hdf5 item '%s'", name); + } if (retval > 0) { @@ -793,7 +797,7 @@ } // Read the next Octave variable from the stream IS, which must really be an -// hdf5_ifstream. Return the variable value in tc, its doc string in doc, and +// hdf5_ifstream. Return the variable value in tc, its docstring in doc, and // whether it is global in global. The return value is the name of the // variable, or NULL if none were found or there was an error. std::string @@ -864,9 +868,9 @@ } else { - // an error occurred (H5Giterate_retval < 0) or there are no - // more datasets print an error message if retval < 0? - // hdf5_read_next_data already printed one, probably. + // An error occurred (H5Giterate_retval < 0), + // or there are no more datasets (H5Giterate_retval == 0). + // hdf5_read_next_data_internal has already printed a warning msg. } if (! d.name.empty ())