[med-svn] [Git][med-team/libminc][master] Fix big-endian minc2-dimension-test failures
Dominique Belhachemi (@domibel)
gitlab at salsa.debian.org
Sun Sep 13 06:04:51 BST 2026
Dominique Belhachemi pushed to branch master at Debian Med / libminc
Commits:
9eb1962d by Dominique Belhachemi at 2026-09-13T00:57:40-04:00
Fix big-endian minc2-dimension-test failures
- - - - -
4 changed files:
- debian/changelog
- − debian/patches/0003-disable-dimension-test.patch
- + debian/patches/0003-fix-bigendian-dimension-length.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -7,6 +7,7 @@ libminc (2.5.0-4) UNRELEASED; urgency=medium
[ Dominique Belhachemi ]
* Use HDF5's CONFIG-mode across libminc's build and its exports
+ * Fix big-endian minc2-dimension-test failures.
-- Dominique Belhachemi <domibel at debian.org> Sat, 12 Sep 2026 20:35:52 -0400
=====================================
debian/patches/0003-disable-dimension-test.patch deleted
=====================================
@@ -1,33 +0,0 @@
-From: Gert Wollny <gewo at debian.org>
-Last-Update: 2022-09-02
-Subject: Disable the minc2 dimension tests, fails on bigendian
-
-Bug: https://github.com/BIC-MNI/libminc/issues/100
-
-This is a temporary measure to get reverese dependencies like ITK
-forward. ITK needs this new version and doesn't run on bigendian
-anyway.
----
- testdir/CMakeLists.txt | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- libminc.orig/testdir/CMakeLists.txt
-+++ libminc/testdir/CMakeLists.txt
-@@ -167,7 +167,7 @@
- add_executable(minc2-create-test-images minc2-create-test-images.c)
- add_executable(minc2-datatype-test minc2-datatype-test.c)
- add_executable(minc2-large-attribute minc2-large-attribute.c)
--add_executable(minc2-dimension-test minc2-dimension-test.c)
-+#add_executable(minc2-dimension-test minc2-dimension-test.c)
- add_executable(minc2-full-test minc2-full-test.c)
- add_executable(minc2-grpattr-test minc2-grpattr-test.c)
- add_executable(minc2-scalar-test minc2-scalar-test.c)
-@@ -216,7 +216,7 @@
- add_minc_test(minc2-datatype-test minc2-datatype-test
- ${CMAKE_CURRENT_BINARY_DIR}/datatype_minc2.mnc)
-
--add_minc_test(minc2-dimension-test minc2-dimension-test)
-+#add_minc_test(minc2-dimension-test minc2-dimension-test)
- add_minc_test(minc2-full-test minc2-full-test)
- add_minc_test(minc2-grpattr-test minc2-grpattr-test)
- add_minc_test(minc2-scalar-test minc2-scalar-test
=====================================
debian/patches/0003-fix-bigendian-dimension-length.patch
=====================================
@@ -0,0 +1,40 @@
+Description: Fix big-endian corruption of irregular dimension "length"
+ miset_attr_at_loc() writes 4 bytes starting at &dimensions[i]->length,
+ which points to an 8-byte misize_t.
+ Big-endian systems pick the wrong half.
+ The fix passes a 4-byte unsigned int instead of the 8-byte misize_t.
+Author: Dominique Belhachemi <domibel at debian.org>
+Bug: https://github.com/BIC-MNI/libminc/issues/100
+Forwarded: no
+Last-Update: 2026-09-13
+---
+--- a/libsrc2/volume.c
++++ b/libsrc2/volume.c
+@@ -781,8 +781,11 @@
+ type (to hdf5) conversion.
+ miset_attr_at_loc(..) is implemented at m2utils.c
+ */
+- miset_attr_at_loc(dataset_width, "length", MI_TYPE_INT,
+- 1, &dimensions[i]->length);
++ {
++ unsigned int dim_len = (unsigned int) dimensions[i]->length;
++ miset_attr_at_loc(dataset_width, "length", MI_TYPE_INT,
++ 1, &dim_len);
++ }
+ /* Close the specified dataset */
+ H5Dclose(dataset_width);
+ free(name);
+@@ -829,8 +832,11 @@
+ }
+
+ /* Save dimension length */
+- miset_attr_at_loc(dataset_id, "length", MI_TYPE_INT,
+- 1, &dimensions[i]->length);
++ {
++ unsigned int dim_len = (unsigned int) dimensions[i]->length;
++ miset_attr_at_loc(dataset_id, "length", MI_TYPE_INT,
++ 1, &dim_len);
++ }
+
+ /* Create Dimension attribute "direction_cosines" */
+ if(dimensions[i]->dim_class == MI_DIMCLASS_SPATIAL)
=====================================
debian/patches/series
=====================================
@@ -1,5 +1,5 @@
0002-initialize_arrays_in_tests.patch
-0003-disable-dimension-test.patch
+0003-fix-bigendian-dimension-length.patch
0004-Fix-setting-of-LIBMINC_USE_FILE_CONFIG-to-be-correct.patch
0005-Disable-setting-RPATH.patch
0006-use-hdf5-config-mode.patch
View it on GitLab: https://salsa.debian.org/med-team/libminc/-/commit/9eb1962de2567e0ea3e25c2578222124d2dc56b4
--
View it on GitLab: https://salsa.debian.org/med-team/libminc/-/commit/9eb1962de2567e0ea3e25c2578222124d2dc56b4
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260913/9eb8dcbe/attachment-0001.htm>
More information about the debian-med-commit
mailing list