[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2-188-g238a3f9
Service Account
noreply at mpich.org
Tue Feb 16 06:40:16 CST 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 238a3f9a5228aa22388a0e1fd7458903e218bfc8 (commit)
via 53e283ed7c7856e419c714b1b6466fb93fa5f356 (commit)
via 395cf9e052a69a7089b462ac08051a766e16d866 (commit)
via 382856b05557d0a2f5c2f9f88134e56d0206172d (commit)
from 60ca21cf73d3cd3d74d36ac4bae50f37d904dfc9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/238a3f9a5228aa22388a0e1fd7458903e218bfc8
commit 238a3f9a5228aa22388a0e1fd7458903e218bfc8
Author: Rob Latham <robl at mcs.anl.gov>
Date: Mon Feb 15 15:13:44 2016 -0600
actually do something if we run out of memory
coverity id #105083
No Reviewer
diff --git a/src/mpi/romio/adio/common/ad_open.c b/src/mpi/romio/adio/common/ad_open.c
index e3f2d34..8fb3d2f 100644
--- a/src/mpi/romio/adio/common/ad_open.c
+++ b/src/mpi/romio/adio/common/ad_open.c
@@ -38,6 +38,14 @@ MPI_File ADIO_Open(MPI_Comm orig_comm,
/* obtain MPI_File handle */
mpi_fh = MPIO_File_create(sizeof(struct ADIOI_FileD));
if (mpi_fh == MPI_FILE_NULL) {
+ *error_code = MPIO_Err_create_code(*error_code,
+ MPIR_ERR_RECOVERABLE,
+ myname,
+ __LINE__,
+ MPI_ERR_OTHER,
+ "**nomem2",0);
+ goto fn_exit;
+
}
fd = MPIO_File_resolve(mpi_fh);
http://git.mpich.org/mpich.git/commitdiff/53e283ed7c7856e419c714b1b6466fb93fa5f356
commit 53e283ed7c7856e419c714b1b6466fb93fa5f356
Author: Rob Latham <robl at mcs.anl.gov>
Date: Mon Feb 15 15:08:47 2016 -0600
checking for null before calling free unnecessary
Coverity 105082
Coverity 105083
Coverity 105360
diff --git a/src/mpi/romio/adio/common/ad_close.c b/src/mpi/romio/adio/common/ad_close.c
index 01cf1ba..49bc8ad 100644
--- a/src/mpi/romio/adio/common/ad_close.c
+++ b/src/mpi/romio/adio/common/ad_close.c
@@ -60,8 +60,8 @@ void ADIO_Close(ADIO_File fd, int *error_code)
ADIOI_Ftable[fd->fortran_handle] = MPI_FILE_NULL;
}
- if (fd->hints && fd->hints->ranklist) ADIOI_Free(fd->hints->ranklist);
- if (fd->hints && fd->hints->cb_config_list) ADIOI_Free(fd->hints->cb_config_list);
+ if (fd->hints) ADIOI_Free(fd->hints->ranklist);
+ if (fd->hints) ADIOI_Free(fd->hints->cb_config_list);
/* This BlueGene platform-specific free must be done in the common code
* because the malloc's for these hint data structures are done at the
@@ -71,9 +71,9 @@ void ADIO_Close(ADIO_File fd, int *error_code)
* ADIOI_GPFS_Close and re-open via ADIOI_GPFS_Open are done which results
* in a double-free - ADIOI_GPFS_Open does not redo the SetInfo... */
#ifdef BGQPLATFORM
- if (fd->hints && fd->hints->fs_hints.bg.bridgelist)
+ if (fd->hints)
ADIOI_Free(fd->hints->fs_hints.bg.bridgelist);
- if (fd->hints && fd->hints->fs_hints.bg.bridgelistnum)
+ if (fd->hints)
ADIOI_Free(fd->hints->fs_hints.bg.bridgelistnum);
#endif
@@ -95,7 +95,7 @@ void ADIO_Close(ADIO_File fd, int *error_code)
ADIOI_Free(fd->file_realm_st_offs);
ADIOI_Free(fd->file_realm_types);
}
- if (fd->hints) ADIOI_Free(fd->hints);
+ ADIOI_Free(fd->hints);
@@ -113,7 +113,7 @@ void ADIO_Close(ADIO_File fd, int *error_code)
MPI_Info_free(&(fd->info));
- if (fd->io_buf != NULL) ADIOI_Free(fd->io_buf);
+ ADIOI_Free(fd->io_buf);
ADIOI_OneSidedCleanup(fd);
/* memory for fd is freed in MPI_File_close */
diff --git a/src/mpi/romio/adio/common/ad_open.c b/src/mpi/romio/adio/common/ad_open.c
index 75f8e0a..e3f2d34 100644
--- a/src/mpi/romio/adio/common/ad_open.c
+++ b/src/mpi/romio/adio/common/ad_open.c
@@ -192,12 +192,12 @@ MPI_File ADIO_Open(MPI_Comm orig_comm,
(*(fd->fns->ADIOI_xxx_Close))(fd, error_code);
}
}
- if (fd->filename) ADIOI_Free(fd->filename);
- if (fd->hints->ranklist) ADIOI_Free(fd->hints->ranklist);
- if (fd->hints->cb_config_list) ADIOI_Free(fd->hints->cb_config_list);
- if (fd->hints) ADIOI_Free(fd->hints);
+ ADIOI_Free(fd->filename);
+ ADIOI_Free(fd->hints->ranklist);
+ ADIOI_Free(fd->hints->cb_config_list);
+ ADIOI_Free(fd->hints);
if (fd->info != MPI_INFO_NULL) MPI_Info_free(&(fd->info));
- if (fd->io_buf) ADIOI_Free(fd->io_buf);
+ ADIOI_Free(fd->io_buf);
ADIOI_Free(fd);
fd = ADIO_FILE_NULL;
if (*error_code == MPI_SUCCESS)
http://git.mpich.org/mpich.git/commitdiff/395cf9e052a69a7089b462ac08051a766e16d866
commit 395cf9e052a69a7089b462ac08051a766e16d866
Author: Rob Latham <robl at mcs.anl.gov>
Date: Mon Feb 15 13:32:30 2016 -0600
coverity: free memory in error cases
coverity id: #105295
Coverity id: #105348
Coverity id: #105251
Coverity id: #105284
Coverity id: #105285
coverity id: #105324
coverity id: #105325
coverity id: #105326
coverity id: #105327
diff --git a/src/mpi/romio/adio/common/ad_fstype.c b/src/mpi/romio/adio/common/ad_fstype.c
index c89b560..75fb24f 100644
--- a/src/mpi/romio/adio/common/ad_fstype.c
+++ b/src/mpi/romio/adio/common/ad_fstype.c
@@ -192,8 +192,8 @@ static void ADIO_FileSysType_parentdir(const char *filename, char **dirnamep)
/* successfully read the link */
linkbuf[namelen] = '\0'; /* readlink doesn't null terminate */
dir = ADIOI_Strdup(linkbuf);
- ADIOI_Free(linkbuf);
}
+ ADIOI_Free(linkbuf);
}
slash = strrchr(dir, '/');
diff --git a/src/mpi/romio/adio/common/ad_hints.c b/src/mpi/romio/adio/common/ad_hints.c
index 869db03..83f0533 100644
--- a/src/mpi/romio/adio/common/ad_hints.c
+++ b/src/mpi/romio/adio/common/ad_hints.c
@@ -259,6 +259,7 @@ void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
len = (strlen(ADIOI_CB_CONFIG_LIST_DFLT)+1) * sizeof(char);
fd->hints->cb_config_list = ADIOI_Malloc(len);
if (fd->hints->cb_config_list == NULL) {
+ ADIOI_Free(value);
*error_code = MPIO_Err_create_code(*error_code,
MPIR_ERR_RECOVERABLE,
myname,
diff --git a/src/mpi/romio/adio/common/ad_iwrite.c b/src/mpi/romio/adio/common/ad_iwrite.c
index 0a3d97e..e72af5f 100644
--- a/src/mpi/romio/adio/common/ad_iwrite.c
+++ b/src/mpi/romio/adio/common/ad_iwrite.c
@@ -162,6 +162,8 @@ int ADIOI_GEN_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset,
if (aio_req != NULL) ADIOI_Free(aio_req);
return 0;
} else {
+ ADIOI_Free(aio_req);
+ ADIOI_Free(aiocbp);
return errno;
}
}
diff --git a/src/mpi/romio/adio/common/cb_config_list.c b/src/mpi/romio/adio/common/cb_config_list.c
index 6b4d82c..d7031ba 100644
--- a/src/mpi/romio/adio/common/cb_config_list.c
+++ b/src/mpi/romio/adio/common/cb_config_list.c
@@ -202,6 +202,7 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm,
procname[0] = ADIOI_Malloc(alloc_size);
if (procname[0] == NULL) {
+ ADIOI_Free(array);
return -1;
}
diff --git a/src/mpi/romio/adio/common/hint_fns.c b/src/mpi/romio/adio/common/hint_fns.c
index 34c898b..5e87e88 100644
--- a/src/mpi/romio/adio/common/hint_fns.c
+++ b/src/mpi/romio/adio/common/hint_fns.c
@@ -12,7 +12,7 @@
int ADIOI_Info_check_and_install_int(ADIO_File fd, MPI_Info info, const char *key,
int *local_cache, char *funcname, int *error_code)
{
- int intval, tmp_val, flag;
+ int intval, tmp_val, flag, ret=0;
char *value;
value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
@@ -37,7 +37,8 @@ int ADIOI_Info_check_and_install_int(ADIO_File fd, MPI_Info info, const char *ke
MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(funcname,
key,
error_code);
- return -1;
+ ret = -1;
+ goto fn_exit;
}
/* --END ERROR HANDLING-- */
@@ -45,14 +46,15 @@ int ADIOI_Info_check_and_install_int(ADIO_File fd, MPI_Info info, const char *ke
/* some file systems do not cache hints in the fd struct */
if (local_cache != NULL) *local_cache = intval;
}
+fn_exit:
ADIOI_Free(value);
- return 0;
+ return ret;
}
int ADIOI_Info_check_and_install_enabled(ADIO_File fd, MPI_Info info, const char *key,
int *local_cache, char *funcname, int *error_code)
{
- int tmp_val, flag;
+ int tmp_val, flag, ret=0;
char *value;
value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
@@ -90,17 +92,19 @@ int ADIOI_Info_check_and_install_enabled(ADIO_File fd, MPI_Info info, const char
MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(funcname,
key,
error_code);
- return -1;
+ ret = -1;
+ goto fn_exit;
}
/* --END ERROR HANDLING-- */
}
+fn_exit:
ADIOI_Free(value);
- return 0;
+ return ret;
}
int ADIOI_Info_check_and_install_true(ADIO_File fd, MPI_Info info, const char *key,
int *local_cache, char *funcname, int *error_code)
{
- int flag, tmp_val;
+ int flag, tmp_val, ret=0;
char *value;
value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
@@ -132,18 +136,19 @@ int ADIOI_Info_check_and_install_true(ADIO_File fd, MPI_Info info, const char *k
MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(funcname,
key,
error_code);
- return -1;
+ ret = -1;
+ goto fn_exit;
}
/* --END ERROR HANDLING-- */
}
-
+fn_exit:
ADIOI_Free(value);
- return 0;
+ return ret;
}
int ADIOI_Info_check_and_install_str(ADIO_File fd, MPI_Info info, const char *key,
char **local_cache, char *funcname, int *error_code)
{
- int flag;
+ int flag, ret;
size_t len;
char *value;
@@ -171,7 +176,8 @@ int ADIOI_Info_check_and_install_str(ADIO_File fd, MPI_Info info, const char *ke
__LINE__,
MPI_ERR_OTHER,
"**nomem2",0);
- return -1;
+ ret = -1;
+ goto fn_exit;
}
ADIOI_Strncpy(*local_cache, value, len);
}
@@ -179,6 +185,7 @@ int ADIOI_Info_check_and_install_str(ADIO_File fd, MPI_Info info, const char *ke
* otherwise we would get an error if someone used the same
* info value with a cb_config_list value in it in a couple
* of calls, which would be irritating. */
+fn_exit:
ADIOI_Free(value);
- return 0;
+ return ret;
}
http://git.mpich.org/mpich.git/commitdiff/382856b05557d0a2f5c2f9f88134e56d0206172d
commit 382856b05557d0a2f5c2f9f88134e56d0206172d
Author: Rob Latham <robl at mcs.anl.gov>
Date: Mon Feb 15 13:47:32 2016 -0600
coverity found more strange pointer comparision
Coverity Id: #104918
Coverity Id: #104919
diff --git a/src/mpi/romio/mpi-io/fsync.c b/src/mpi/romio/mpi-io/fsync.c
index 7b2ef12..00c9499 100644
--- a/src/mpi/romio/mpi-io/fsync.c
+++ b/src/mpi/romio/mpi-io/fsync.c
@@ -49,7 +49,7 @@ int MPI_File_sync(MPI_File fh)
adio_fh = MPIO_File_resolve(fh);
/* --BEGIN ERROR HANDLING-- */
- if ((adio_fh <= (MPI_File) 0) || ((adio_fh)->cookie != ADIOI_FILE_COOKIE))
+ if ((adio_fh == NULL) || ((adio_fh)->cookie != ADIOI_FILE_COOKIE))
{
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_ARG,
diff --git a/src/mpi/romio/mpi-io/get_view.c b/src/mpi/romio/mpi-io/get_view.c
index e6d1d63..6919849 100644
--- a/src/mpi/romio/mpi-io/get_view.c
+++ b/src/mpi/romio/mpi-io/get_view.c
@@ -56,7 +56,7 @@ int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype,
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
- if (datarep <= (char *) 0)
+ if (datarep == NULL)
{
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_ARG,
-----------------------------------------------------------------------
Summary of changes:
src/mpi/romio/adio/common/ad_close.c | 12 +++++-----
src/mpi/romio/adio/common/ad_fstype.c | 2 +-
src/mpi/romio/adio/common/ad_hints.c | 1 +
src/mpi/romio/adio/common/ad_iwrite.c | 2 +
src/mpi/romio/adio/common/ad_open.c | 18 +++++++++++----
src/mpi/romio/adio/common/cb_config_list.c | 1 +
src/mpi/romio/adio/common/hint_fns.c | 33 +++++++++++++++++-----------
src/mpi/romio/mpi-io/fsync.c | 2 +-
src/mpi/romio/mpi-io/get_view.c | 2 +-
9 files changed, 46 insertions(+), 27 deletions(-)
hooks/post-receive
--
MPICH primary repository
More information about the commits
mailing list