Skip to content
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

H5LS-tattrreg_be test fails on OpenBSD PowerPC #1214

Open
seanm opened this issue Nov 22, 2021 · 14 comments
Open

H5LS-tattrreg_be test fails on OpenBSD PowerPC #1214

seanm opened this issue Nov 22, 2021 · 14 comments
Assignees
Labels
Component - High-Level Library Code in the hl directory Priority - 2. Medium ⏹ It would be nice to have this in the next release Type - Bug Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub

Comments

@seanm
Copy link
Contributor

seanm commented Nov 22, 2021

With current master plus this patch: #1195

I can build HDF5 and most tests pass. But the H5LS-tattrreg_be test fails:

The output is:

EXPECT=0" "-D" "TEST_REFERENCE=tattrreg_be.ls" "-P" "/home/builder/external/hdf5/config/cmake_ext_mod/runTest.cmake"                                                                      <
-- Require TEST_EXPECT to be defined
-- COMMAND:  /home/builder/external/hdf5-bin/bin/h5ls-shared -w80;-v;-d;tattrreg.h5
-- COMMAND Result: 0
-- COMMAND Error: 
-- line = 30
***ACTUAL:     Type:      native hbool_t
****REFER:     Type:      native unsigned char

-- COMPARE Result: 1
CMake Error at /home/builder/external/hdf5/config/cmake_ext_mod/runTest.cmake:276 (message):
  Failed: The output of tattrreg_be.out did not match tattrreg_be.ls

Does the be in this test name mean 'big endian'? I imagine you don't test many of those anymore, but this old PowerMac G5 is big endian.

@epourmal
Copy link

epourmal commented Nov 22, 2021 via email

@seanm
Copy link
Contributor Author

seanm commented Nov 22, 2021

Sorry, indeed, I'm using the develop branch. Just so used to saying master when I mean 'newest'. :)

What OS do you test PowerPC with?

@epourmal
Copy link

epourmal commented Nov 22, 2021 via email

@byrnHDF
Copy link
Contributor

byrnHDF commented Nov 22, 2021

I wonder if the compiler version is the issue - hbool_t might be different between compiler versions. On our machine os/compiler version it produces unsigned char.

@seanm
Copy link
Contributor Author

seanm commented Nov 22, 2021

Not sure I understand... According to H5public.h it's always typedef bool hbool_t; I don't find any typedef unsigned char hbool_t;, but maybe I'm just not finding it...

@byrnHDF
Copy link
Contributor

byrnHDF commented Nov 22, 2021

We have to look at h5ls print_native_type function there is a H5Tequal if/else block that checks the "hid_t type".
else if (H5Tequal(type, H5T_NATIVE_UCHAR) == TRUE) {
h5tools_str_append(buffer, "native unsigned char");
}

That function is called by print_type, which is called after getting the type from the dataset with a H5Dget_type call.

@byrnHDF
Copy link
Contributor

byrnHDF commented Nov 22, 2021

BTW, the boolean check is at the bottom of the tree;
else if (H5Tequal(type, H5T_NATIVE_HBOOL) == TRUE) {
h5tools_str_append(buffer, "native hbool_t");
}

@seanm
Copy link
Contributor Author

seanm commented Nov 23, 2021

it does indeed go into the else if (H5Tequal(type, H5T_NATIVE_HBOOL) == TRUE) branch at the end

@seanm
Copy link
Contributor Author

seanm commented Jan 10, 2022

@byrnHDF friendly ping... what does it tell us that I get into that branch at the end?

@byrnHDF
Copy link
Contributor

byrnHDF commented Jan 11, 2022

@byrnHDF friendly ping... what does it tell us that I get into that branch at the end?

Only that on that machine H5T_NATIVE_HBOOL matches the datatype - native datatypes are machine/os/compiler dependent.

@seanm
Copy link
Contributor Author

seanm commented Jan 12, 2022

Sorry, I don't quite grok that... has this identified the problem? or the solution?

@byrnHDF
Copy link
Contributor

byrnHDF commented Jan 12, 2022

Not sure - only that there can be differences depending on machine/os/compiler. I might be wrong but I think I have run into NATIVE type differences before. Better is to use STD types.

@gnuoyd
Copy link
Contributor

gnuoyd commented Jan 12, 2022 via email

@seanm
Copy link
Contributor Author

seanm commented Jan 13, 2022

CC: @hyoklee

@derobins derobins added Priority - 2. Medium ⏹ It would be nice to have this in the next release Component - High-Level Library Code in the hl directory Type - Bug Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub labels May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - High-Level Library Code in the hl directory Priority - 2. Medium ⏹ It would be nice to have this in the next release Type - Bug Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub
Projects
None yet
Development

No branches or pull requests

6 participants