Segmentation fault

Hi,

I am relatively new to using the hdf5 code, and am having trouble reading in a .h5 file. I have followed to examples on the hdfgroup website, but I when read in the file, I am getting a segmentation fault. I was hoping someone might be able to point out where I am making a memory mistake. I have attached a copy of my code. Also, the data set I am attempting to read is a 1051200 by 2 matrix with a complex compound datatype in each of the cells. Thanks in advance for any help.

Scott

readattempt.cpp (4.83 KB)

Scott,

Welcome to using HDF5. How do you normally approach debugging a
segmentation fault? Have you run the code under a debugger to
determine the line on which the seg fault is occurring?

If you are attempting to read a 1051200x 2 array I would expect to see
an array of that size declared in your code, but I don’t see it. That
might be a problem.

It has been a long while since I’ve written used C++, so perhaps I’m
missing something but hasn’t the malloc function been superceded by the
new statement in C++?

Cheers,

–dan

Scott Mishra wrote:

···

Hdf-forum@hdfgroup.orghttp://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

-- Daniel Kahn
Science Systems and Applications Inc.
301-867-2162