bugGNU Octave - Bugs: bug #38789, segfault on exit after failing to...

 
 

bug #38789: segfault on exit after failing to load HDF5 file

Submitted by:  Markus Appel <mappel>
Submitted on:  Sat 20 Apr 2013 06:52:04 PM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Crash
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat 12 Oct 2013 07:25:58 PM UTC, comment #8:

Markus, I tested your patch against the example attached to this bug report and it worked for me. I applied your changeset here (http://hg.savannah.gnu.org/hgweb/octave/rev/d0a197b9962a). I amended the commit message to also include the file name and function that was modified and what was done. Generally the first line of the commit message is generic ("fixed bug #####") and the rest of the commit message contains some small detail on a per function basis about what was done.

I'm closing the report and also marking it off the Bug Fix List for the 3.8 release. Thanks for the patch.

Rik <rik5>
Project Administrator
Sat 12 Oct 2013 07:15:29 PM UTC, comment #7:

The segfault on exit (without this patch applied) only occurs for me when using HDF5 built with one of the MPI libraries, not with the ordinary non-MPI HDF5.

With the patch applied, load works and no segfault on exit with either MPI or non-MPI HDF5.

Mike Miller <mtmiller>
Project Member
Sat 12 Oct 2013 07:09:52 PM UTC, comment #6:

Patch applies cleanly for me, and I can now load the attached file that used to cause octave to crash.

On the current tip, without this patch, it no longer crashes for me but does throw an error:

Mike Miller <mtmiller>
Project Member
Sat 12 Oct 2013 05:51:55 PM UTC, comment #5:

I haven't tested it, but the patch looks OK to me.

John W. Eaton <jwe>
Project Administrator
Sun 06 Oct 2013 01:30:19 AM UTC, comment #4:

I attached a small patch for loading fixed length string arrays from (3rd party) hdf5 files, the space for \0 was missing. Also, the octave charMatrix gets initialized with blanks to accommodate shorter rows.

I am still not sure whether the segfault was caused by the wrong string length or incorrect error handling during the loading process.

(file #29302)

Markus Appel <mappel>
Mon 30 Sep 2013 01:22:43 AM UTC, comment #3:

Confirming the crash, agree that we should address the crash on exit. Also agree that Octave is not expected to read all HDF files.

Mike Miller <mtmiller>
Project Member
Sun 21 Apr 2013 11:34:34 AM UTC, comment #2:

The crash is mostly the reason why I posted the bug, reading the hdf file ... would be nice.

Anyway, how do you see a possible implementation of reading arbitrary hdf-files? An extension of the existing load function, or a set of new functions e.g. in a forge package?

All the solutions I found up to now (h5read from the h5utils ubuntu package, hdf5oct from github) somehow read either only slices of datasets (not the entire set) and/or no string variables.

Markus Appel <mappel>
Sun 21 Apr 2013 01:55:07 AM UTC, comment #1:

The octave-core file is used to save the top-level workspace variables from your Octave session if Octave crashes. It's not a system core dump file.

I agree that the crash should not happen and is definitely a bug, but I would not classify the failure to read the HDF file as a bug. The HDF support in Octave's load function is only intended to be able to read HDF files produced by Octave's save command. It was not designed to be able to read arbitrary HDF files.

John W. Eaton <jwe>
Project Administrator
Sat 20 Apr 2013 06:52:04 PM UTC, original submission:

Trying to load the attached (3rd party) hdf5 file results in an error. Octave remains functional, but closing the session ends in a segfault:

The resulting file octave-core has zero size.

Here is some complementary information of what I am trying to do, in case it helps:

I want to read NeXus files ( nexusformat.org ) which is a format specification built on top of HDF5. The attached file is a test data set also downloadable from:

http://trac.nexusformat.org/code/browser/tags/4.3.0/test/data/dmc02.h5

It is a completely valid HDF5 file (at least h5check tells me so). I started to remove data sets and groups from the file to figure out what prevents octave from successfully reading it. My strong suspicion is that fields containing strings cause the error. If I remove all string fields, the file can be read without problems. It still works if I leave some string fields in the file, but it seems not to be a certain string field that causes the error.

Some strings which could be read are missing the last character, so it might be connected to #35227 . An error upon exit after reading hdf5 is also described in #37713 but I am not sure whether it is related to this bug.

octave was built from 3.6.4 source on Ubuntu 12.04 with libhdf5-serial-dev 1.8.4-patch1-3ubuntu2 installed

Markus Appel <mappel>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #29302:  hdf_string_arrays.diff added by mappel (2kB - text/x-patch)
file #27913:  dmc02.h5 added by mappel (29kB - application/x-hdf)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by mappel (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 12 Oct 2013 07:25:58 PM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Sat 12 Oct 2013 05:43:52 PM UTCrik5StatusConfirmed=>Patch Submitted
    Sun 06 Oct 2013 01:30:19 AM UTCmappelAttached File-=>Added hdf_string_arrays.diff, #29302
    Mon 30 Sep 2013 01:22:43 AM UTCmtmillerCategoryNone=>Libraries
      StatusNone=>Confirmed
      Release3.6.4=>dev
    Sat 20 Apr 2013 06:52:04 PM UTCmappelAttached File-=>Added dmc02.h5, #27913

    Back to the top


    Powered by Savane 3.1-cleanup