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

Fixes a bug where t_cache fails due to a string size being too small #1720

Merged
merged 2 commits into from
May 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions testpar/t_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,8 @@ setup_derived_types(void)
MPI_Aint displs[9];
struct mssg_t sample; /* used to compute displacements */

HDmemset(&sample, 0, sizeof(struct mssg_t));
Copy link
Member Author

@derobins derobins May 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleans a "maybe ininitialized" warning


/* setup the displacements array */
if ((MPI_SUCCESS != MPI_Get_address(&sample.req, &displs[0])) ||
(MPI_SUCCESS != MPI_Get_address(&sample.src, &displs[1])) ||
Expand Down Expand Up @@ -6981,7 +6983,7 @@ main(int argc, char **argv)

/* fix the file names */
for (u = 0; u < sizeof(FILENAME) / sizeof(FILENAME[0]) - 1; ++u) {
if (h5_fixname(FILENAME[u], fapl, filenames[u], sizeof(filenames[u])) == NULL) {
if (h5_fixname(FILENAME[u], fapl, filenames[u], PATH_MAX) == NULL) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked and all other similar changes in the PR that introduced the bug were switched to use PATH_MAX

nerrors++;
if (verbose)
HDfprintf(stdout, "%d:%s: h5_fixname() failed.\n", world_mpi_rank, __func__);
Expand Down Expand Up @@ -7085,8 +7087,8 @@ main(int argc, char **argv)
MPI_Barrier(MPI_COMM_WORLD);
if (MAINPROCESS) { /* only process 0 reports */
HDprintf("===================================\n");
if (failures) {
HDprintf("***metadata cache tests detected %d failures***\n", failures);
if (nerrors || failures) {
HDprintf("***metadata cache tests detected %d failures***\n", nerrors + failures);
}
else {
HDprintf("metadata cache tests finished with no failures\n");
Expand All @@ -7103,5 +7105,5 @@ main(int argc, char **argv)
MPI_Finalize();

/* cannot just return (failures) because exit code is limited to 1byte */
return (failures != 0);
return (nerrors != 0 || failures != 0);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little weird, but setup errors and test errors are tracked separately.

}