I have been attempting to update to the latest HDF5DotNet wrappers (1.8.7)
and am getting the following warnings (when running in DEBUG mode from
VS2010):
PInvokeStackImbalance was detected
Message: A call to PInvoke function 'HDF5DotNet!<Module>::H5Fopen' has
unbalanced the stack.
This is likely because the managed PInvoke signature does not match the
unmanaged target signature.
Check that the calling convention and parameters of the PInvoke signature
match the target unmanaged signature.
I am using the pre-compiled binaries (HDF5DotNet assembly for .NET Framework
4.0 32-bit), but got the same result when I compiled from source.
Strangely, when executing my application that calls the HDF5DotNet wrappers
in non-DEBUG mode, I see no problems. I did notice that between 1.8.6 and
1.8.7 all the calling conventions were switched from Cdecl to StdCall.
Could this be causing this?
I have been attempting to update to the latest HDF5DotNet wrappers (1.8.7)
and am getting the following warnings (when running in DEBUG mode from
VS2010):
PInvokeStackImbalance was detected
Message: A call to PInvoke function 'HDF5DotNet!<Module>::H5Fopen' has
unbalanced the stack.
This is likely because the managed PInvoke signature does not match the
unmanaged target signature.
Check that the calling convention and parameters of the PInvoke signature
match the target unmanaged signature.
I am using the pre-compiled binaries (HDF5DotNet assembly for .NET Framework
4.0 32-bit), but got the same result when I compiled from source.
Strangely, when executing my application that calls the HDF5DotNet wrappers
in non-DEBUG mode, I see no problems. I did notice that between 1.8.6 and
1.8.7 all the calling conventions were switched from Cdecl to StdCall.
Could this be causing this?
The HDF5DotNet wrapper-library is calling the HDF5 1.8.7 library.
It looks like changing all the calling conventions for the HDF5 library
prototypes in the HDF5DotNet files from
"CallingConvention=CallingConvention::StdCall" to
"CallingConvention=CallingConvention::Cdecl" fixed the problem (at least
made the MDA/PInvokeStackImbalance go away).
I don't know why they were changed from Cdecl originally to StdCall anyway
(as it appears that the HDF5 library expects cdecl). Any ideas?
Josha, switching the calling conventions is the right thing to do. We'll
update the source and provide new binaries by Monday (5/27).
Note: this is a 32-bit Windows issue, since there is only one calling
convention
in 64-bit Windows.
The HDF5DotNet wrapper-library is calling the HDF5 1.8.7 library.
It looks like changing all the calling conventions for the HDF5 library
prototypes in the HDF5DotNet files from
"CallingConvention=CallingConvention::StdCall" to
"CallingConvention=CallingConvention::Cdecl" fixed the problem (at least
made the MDA/PInvokeStackImbalance go away).
I don't know why they were changed from Cdecl originally to StdCall anyway
(as it appears that the HDF5 library expects cdecl). Any ideas?