Closed lellid closed 1 month ago
Which version of PureHDF are you running and on which OS? With the current version (1.0.0-beta.16
) the code
var len = 3;
var dataArr = new double[len];
var dataset = new H5Dataset(dataArr, fileDims: [(ulong)len]);
var file = new H5File()
{
["raw"] = dataset,
};
file.Write("/home/vincent/Downloads/out.h5");
runs well for me on Ubuntu 24.04.
Thanks :-)
It succeeds unter .Net8.05, but fails with a StackoverflowException under NetFramework 4.8.9232.0, using Windows 10.0.19045, with the version of PureHDF of 1.0.0-beta.16. An excerpt of the stack is:
System.Memory.dll!System.SpanHelpers.CopyTo<byte>(ref byte dst, int dstLength, ref byte src, int srcLength)
System.Memory.dll!System.Span<byte>.TryCopyTo(System.Span<byte> destination)
System.Memory.dll!System.Span<byte>.ToArray()
PureHDF.dll!PureHDF.StreamExtensions.Write(System.IO.Stream stream, System.Span<byte> buffer)
PureHDF.dll!PureHDF.StreamExtensions.Write(System.IO.Stream stream, System.Span<byte> buffer)
[The 1 frame(s) above this were repeated 12612 times]
PureHDF.dll!PureHDF.StreamExtensions.Write(System.IO.Stream stream, System.Span<byte> buffer)
PureHDF.dll!PureHDF.VFD.H5StreamDriver.Write(System.Span<byte> data)
PureHDF.dll!PureHDF.VOL.Native.ObjectHeader2.Encode(PureHDF.VOL.Native.NativeWriteContext context)
PureHDF.dll!PureHDF.H5NativeWriter.InternalEncodeDataset<double[], double>(PureHDF.H5Dataset dataset, double[] data, bool isScalar)
Hope that helps.
Best regards, Dirk
Thanks for that hint, I will try to reproduce it!
The bug should be solved in version v1.0.0-beta.17 :-)
Yes, it works now! Thanks a lot!
Hi, I have the following code:
(The reason why I used an
H5Dataset
instead of an array is that later on I want to add attributes to the dataset, and modify the dimensions) The code shows a StackoverflowException when it reachesfile.Write
, in the methodH5NativeWriter.EncodeDataset
. Is this a bug, or did I use something in the wrong way?Best regards, Dirk