New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alignment issues with python3 #734
Comments
Yes, this should not be happening. We need to find the root of the problem, but if the meanwhile you can contribute a solution, we will be really grateful! |
I can reproduce this on my Windows / python 3.7 env. The hdf5 contains:
and
I'll investigate. This may be due to the table information not being correct. As the testfile was not created using pytables. |
I just ran into the same issue. If it helps, this also occurs in Python2. |
Thanks putting the finger on the sore spot @tkintscher: I can confirm this broke between 3.4.4 and 3.5.1. Comparing: v3.4.4...v3.5.1 |
I checked / review the offsets PR, but could not find anything wrong. I'm do not have time to investigate further, so I'm leaving some verbose info about this:
This struct should be 8 bytes. In fact, it is 8 bytes when I recreate the dataset. |
One thing to note is that the library that wrote the test file above creates compound types whose size is guaranteed to be a multiple of the size of the widest supported type (currently
. This means that you can potentially run into trouble if you assume the size of an item is the offset+size of the last field. It looks like this is what's happening here: even in v3.5.2, |
I suspect that the underlying issue here is that the only way to control the padding in a |
@jvansanten: It should be possible to extract the correct |
Right, it looks like you should be able to reach slightly deeper into |
Setting the correct In the interactive session below, I set
Unfortunately setting the correct dtype for the Table upon initialisation does not seem to be a oneliner fix... But I'll work on it some more, when time permits. |
Regression test for PyTablesgh-734 Test if a H5T_COMPOUND (Table) with padding can be read properly. (test if dtype.itemsize set correctly)
Regression test for PyTablesgh-734 Test if a H5T_COMPOUND (Table) with padding can be read properly. (test if dtype.itemsize set correctly)
@tomkooij, thanks for looking into this and fixing it! |
There seems to be some sort of alignment issue with python3 on Macos. With this test file in python2 i get the correct results:
However with python3 i get:
It appears to be some sort of alignment issues because if each row is 128 bytes it works fine and with other size rows I get segfaults.
This only happens with files written with the libhdf5 and not files written by pytables. I put the test file on my website since, git doesn't let me upload hdf5 files (even though it is only 8K)
https://icecube.wisc.edu/~kmeagher/test.hdf5
The text was updated successfully, but these errors were encountered: