-
Notifications
You must be signed in to change notification settings - Fork 261
Test failure on s390x: test_nib_tck2trk #775
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
Comments
Thanks for the report. Not having an s390x system to work on, do you think you could drop into e.g., $ nosetests --pdb nibabel/tests/test_scripts.py
(pdb) locals() |
I'll do it over the weekend. I'll have to figure out how we Fedora folks get access to s390x test machines too . |
Hi @sanjayankur31 any news? Looking to release in the next week or so, and would love to try to get this resolved before then. |
I've got access to a machine now, but I haven't had a chance to look into it. Sorry. Hopefully this week. |
Okay. If not, we'll get to it when we can. Bugs are always there to be fixed. |
confirming that the bug is still there with a doctest to follow up
here is some variables
PS if interested -- there is a software s390 emulator -- https://hercules-390.github.io/html/ although I have not tried it for ages. Also I see |
hm, I am a bit confused. backtrace points to line 683 but listing to 701
but listing lists 701 as the current one
as for variables around 683 -- seems to be kosher or what am I missing?
|
ah -- file is too small so either nb_pts is off or file writing (which generated that file) is buggy?
|
@yarikoptic Thanks, it looks like an endianness problem. The >>> np.int32(3).newbyteorder()
50331648 So the question is whether that part of the file got written big endian or is was little endian but is being read as big endian. Are you able to copy that file over and read it on a little-endian machine? |
@MarcCote I'm going to rope you in on this one. It looks like there's an issue either with reading or writing TRK files on big-endian systems. I don't have one to play with at the moment, so I can't give you a lot more details, but it may be easier for you to check through the potential break points for logic errors. |
FWIW here is the file http://onerussian.com/tmp/standard.trk |
Yup, failing on mine. So it seems |
It was the other way around. Part of the header was written big-endian, so the endianness for the entire file was detected as big-endian. When encountering the number of points, which were separately encoded little-endian, the ordering was reversed. This was the header after being byte swapped to big-endian: {
'magic_number': b'TRACK',
'dimensions': array([1024, 1280, 1792], dtype=int16),
'voxel_sizes': array([4.6006e-41, 2.3049e-41, 8.9683e-44], dtype=float32),
'origin': array([0., 0., 0.], dtype=float32),
'nb_scalars_per_point': 0,
'scalar_name': array([b'', b'', b'', b'', b'', b'', b'', b'', b'', b''], dtype='|S20'),
'nb_properties_per_streamline': 0,
'property_name': array([b'', b'', b'', b'', b'', b'', b'', b'', b'', b''], dtype='|S20'),
'voxel_to_rasmm': array([[4.6006e-41, 0.0000e+00, 0.0000e+00, 0.0000e+00],
[0.0000e+00, 2.3049e-41, 0.0000e+00, 0.0000e+00],
[0.0000e+00, 0.0000e+00, 8.9683e-44, 0.0000e+00],
[0.0000e+00, 0.0000e+00, 0.0000e+00, 4.6006e-41]], dtype=float32),
'reserved': b'',
'voxel_order': b'RAS',
'pad2': b'',
'image_orientation_patient': array([0., 0., 0., 0., 0., 0.], dtype=float32),
'pad1': b'',
'invert_x': b'',
'invert_y': b'',
'invert_z': b'',
'swap_xy': b'',
'swap_yz': b'',
'swap_zx': b'',
'nb_streamlines': 2013265920,
'version': 2,
'hdr_size': 1000,
'endianness': '>',
'_offset_data': 1000
} I've created #782, which should resolve this. @yarikoptic Doctest bug included. |
Sorry, I'm just seeing this issue (and your fix) now. Good catch :D. |
While updating the Fedora package to 2.4.1, we received build failures on s390x.
Hardware information:
Only one test fails:
The complete build log is here:
build.txt
The build completes fine on x86_64, i686, ppc64le, and armv7hl
The text was updated successfully, but these errors were encountered: